Translation of CAD drawings (DWG, DXF) with TransTools for AutoCAD

December 24, 2021
  1. Introduction
  2. Installing AutoCAD and preparing its workspace for translation
  3. Locating the translatable text
  4. Preparing a drawing for translation
  5. Extracting text from a drawing with TransTools for AutoCAD
  6. Importing the translation table into the CAT program
  7. Translation inside your CAT tool
  8. Importing translations into the drawing with TransTools for AutoCAD
  9. Formatting the drawing after translation
  10. Additional self-learning material
  11. Referenced files

1. Introduction

No physical product or a complex object can be created without drawings. The most common software for creating drawings is AutoCAD© developed by Autodesk. Drawings developed in AutoCAD have DWG or (rarely) DXF extension.

Like any documentation, drawings contain textual information that needs to be translated into other languages. However, compared to more traditional document formats, CAD drawings have a number of key differences which make the translation process more difficult. Also, CAT tool enthusiasts will have an unpleasant surprise: CAD formats (DWG, DXF) are not supported by most CAT tools, so you would need to use intermediate tools that can extract the translatable text from a drawing and then replace the original text with its translation.

There are two main ways to present text in translated drawings:

  1. single-language drawing where source text is replaced with its translation, and
  2. multi-language drawing containing text in its original language as well as text in target language(s).

In this article, we will look at the first option – translating a single-language CAD drawing into a target language. You will learn the following:

  • how to locate the translated text in a drawing and how to prepare a drawing for translation,
  • how to translate a drawing using special tools for extracting text from a drawing and importing translations back into the drawing,
  • how to use AutoCAD in order to correct the format of the drawing after translation prior to delivering the translation to the customer.

As an example, we will be using the Blocks and Tables DWG file from the official Autodesk website. It can be found within the ZIP package attached to this post (blocks_and_tables.dwg).

2. Installing AutoCAD and preparing its workspace for translation

If you have not yet installed AutoCAD, do so. You can download AutoCAD from the official AutoDesk website from this link. You can also use older versions of AutoCAD, preferably AutoCAD 2008 or higher. Please note that you need the standard version of AutoCAD for the Windows operating system (32-bit version if you have a 32-bit Windows OS, or 32-bit or 64-bit version if you have a 64-bit Windows OS). AutoCAD LT (limited version of AutoCAD) or the Mac OS version will not be suitable because they do not support specialized add-ons that we will use for extracting translatable text and importing translations back.

During the installation process, you will be prompted to select additional components. One such component is Express Tools add-on. This add-on contains a couple of useful commands that will be very handy when preparing drawings for translation. To install this add-on, check the appropriate box. Depending on your version of AutoCAD, you may need to switch to custom installation mode in order to select components that will be installed. In case you forgot to install Express Tools, please refer to this help article.

To extract translatable text and import translations back, we will use a special add-on called “TransTools for AutoCAD. You can download it (as part of TransTools) from the Downloads page.

Once you have downloaded TransTools_Installer.exe file, double-click it to install the software, making sure to check the box for “TransTools for AutoCAD” component. After installation, you will find the TransTools for AutoCAD.dvb application file in the selected directory (usually C:\Users\username\Documents\TransTools where username is your Windows user name).
During installation, TransTools for Word plug-in cannot be deselected as it is a mandatory component. If you would like to install TransTools for AutoCAD only, please use the manual installation package found on the same web page under “TransTools Manual Installation package”.

Finally, to use TransTools for AutoCAD, we will need AutoCAD VBA Enabler add-on which allows you to use external add-ons created with Visual Basic programming language inside AutoCAD. You can download it from one of the links listed at TransTools for AutoCAD Documentation page in the section titled “Prerequisites: Visual Basic for Applications (VBA) support in AutoCAD”. Depending on the version of AutoCAD you have installed and its type – 32-bit or 64-bit – download the appropriate version of AutoCAD VBA Enabler and then install it.

Note: if your version of AutoCAD is older than 2010, VBA Enabler needs to be installed by selecting the appropriate component during AutoCAD installation.

Now, when you have downloaded and installed all the required applications, you can finally run AutoCAD to perform the initial configuration of the working environment.

Make sure that “Object snap tracking (AUTOSNAP)” and “Object snap (OSNAP)” options in the status bar are switched off. If these options are activated, it will be a bit difficult for you to work with text labels in a drawing.

AUTOSNAP and OSNAP options in AutoCAD status bar

Finally, to be able to extract text from drawings and import the translations back into the drawing, you need to load TransTools for AutoCAD add-on. To do this, perform the following steps:

  • If TransTools is not listed in the startup list (see below), load it as follows:

    Click the Load Application button under the Manage tab. In the dialog that pops up, find TransTools for Autocad.dvb file and click the “Load” button. At the bottom of the dialog, you will see a message “TransTools for AutoCAD.dvb was successfully loaded”. Click the “Close” button.

    Note: in some cases, a security warning about loading an unsigned application file will be displayed. In that case, click Load button in this window to confirm loading the application.

  • If you use TransTools for AutoCAD frequently, configure AutoCAD to load this application automatically when AutoCAD starts.

    To do this, open Load/Unload Applications dialog as shown in point 1 above.

    Configuring AutoCAD to load TransTools automatically - Load/Unload Applications dialog

    Click Contents button in Startup Suite section as shown above.

    Configuring AutoCAD to load TransTools automatically - Startup Suite dialog

    Add TransTools for AutoCAD.dvb file using the Add button and click Close.

    Next time you start AutoCAD, TransTools for AutoCAD will be loaded automatically.

Unless you have configured AutoCAD to load TransTools for AutoCAD automatically on start-up, you will need to load TransTools for AutoCAD manually each time you want to use it.

3. Locating the translatable text

Any CAD drawing consists of the model and layouts.

The Model is a special unlimited space for creating drawing objects (geometric shapes, text objects, etc.). The Model is the first sheet in any CAD drawing and it is titled “Model” or its localized version depending on the AutoCAD user interface language. Normally, the Model is not printed.

Model and layout tabs in AutoCAD

Layouts are special areas for printing or exporting drawing objects formatted for a specific page size (A3, A2, A4, etc.). Layouts are often titled “Layout1”, “Layout2”, ... or the appropriate localized version depending on the AutoCAD user interface language, but they can be renamed by the user (as in Excel).

A distinctive feature of layouts is that the drawing objects located inside them can either be located on the layout itself or “projected” from the Model through a so-called viewport (VP). When projected through a viewport, drawing objects are actually located inside the model and not inside the layout.

Since drawings often contain a lot of unnecessary information that does not require translating, you will need to learn how to tell which text requires translation before extracting it.

For our sample file blocks_and_tables.dwg, let us determine where the translatable text displayed in “ISO A1” layout is actually located.

To do this, open the drawing, switch to “ISO A1” layout and hover the mouse over the objects shown in the drawing.

Identifying location of text in sample drawing

When you move the mouse over objects 3, 4, 5, 6 and 9 as labelled above, you will see that they are highlighted as soon as the mouse is over them (similar to object 5 highlighted in the screenshot). This is a sure sign that the object is on the current layout.

When you move the mouse over tables 7 and 8, they are not highlighted, but they become editable as soon as you left-click them once. This also means that the tables are located in the current layout.

When you hover the mouse over objects 1 and 2, they are not highlighted and a single left-click does not do anything either. To “enter” such objects, you need to double-click them. These are viewports projecting parts of the model.

Text inside viewport

It should be noted that the border around a viewport may be visible even if you have not yet entered the viewport. When entering a viewport, the status bar can display a closed or open lock as shown in the above screenshot.

Attention: if the lock is open (i.e. the viewport is unlocked), do not rotate the mouse wheel and do not pan (move left / right / up / down), otherwise you will change the appearance of the model projection within the layout and you will have to close the drawing without saving and then reopen it in order to avoid changing the original appearance of the layout. Instead, exit the viewport by pressing the Escape key.

So, we have determined that, in order to translate ISO A1 layout, it is not sufficient to extract and translate the text on ISO A1 layout itself, but it is also necessary to translate the text located inside the model. However, remember that the model may contain a lot of unnecessary text that is not projected via viewports into translatable layouts and so should be ignored during translation. Therefore, you need to take a close look at the model: does it contain extra text missing from the viewports? If so, you will need to be selective in extracting only the translatable text from the model. Otherwise, you can safely extract all the text from the model.

Some CAD designers place full printable drawings directly inside the model. In such case all drawing objects are located inside the model, as viewports can never be used inside layouts.

Now let’s see what kinds of drawing objects can hold translatable text:

  • Text objects. There may be two types of text objects: TEXT (one-line text objects) and MTEXT (multi-line text objects). It is more common to use MTEXT objects, i.e. text objects in which the text wraps to the next line if it does not fit within the current width. However, often enough you can also encounter TEXT (one-line) objects which cause a lot of difficulties during translation: 1) if the text expands during translation, it will not wrap to the next line and you will need to change the font size or other parameters after translation, 2) TEXT objects may contain only part of a sentence and it is therefore necessary to combine several TEXT objects into one MTEXT object before translation (see below).
  • Dimension leaders – dimension label with an arrow:
    Example of dimension leader
  • Tables (objects 7 and 8 in the above example)
  • Blocks – composite objects made up of several simpler objects (like grouped objects in Microsoft Office drawings). They are designed to speed up the drafting process. For example, an office plan might comprise 10 instances of a block called “table” which will vary in orientation, color, or text labels, but they will all be based on the same block definition (block template). Blocks contain two types of text labels: 1) text objects inside the block template – these text labels are identical in each instance of the block placed on the drawing; 2) block attributes which are different in different instances of the same block. Also, a block template may contain instances of other blocks, for example, two different table block templates can contain instances of the same block template called “table lamp”.
  • Embedded objects (Excel, etc.) – document of another format (e.g., Microsoft Excel) inserted into the drawing file. Embedded objects must be edited in the appropriate application (for example, an embedded Excel spreadsheet requires Microsoft Excel to edit it). To edit such objects, you need to right-click and select OLE > Open menu item. Text inside embedded objects cannot be retrieved by external applications, so it can only be translated manually.

4. Preparing a drawing for translation

So, we have determined where the translatable text is located. We now need to prepare the drawing for translation. To do this, you need to check whether the drawing contains sentences split across several TEXT (one-line) objects and then combine such TEXT objects into MTEXT objects. This can be done in two different ways:

  • Move the mouse over all layouts and areas of the model which require translation. One-line text objects will be highlighted separately and the tooltip will say “Text” as shown below.
    Tooltip for one-line text objects
  • Extract text from the drawing using TransTools for AutoCAD (see below), enable “Include text information (layer, type)” option in Translation Table Format settings of Extract Translatable Text dialog, and then check the exported table for rows which contain the word “Text” in the third column.

    Options in TransTools Extract Translatable Text tool to help identify one-line text objects

    Identifying one-line text objects in translation table

    Check whether such rows contain bits and pieces of full sentences (as in the example on the above screenshot).

So, we have found two one-line text objects that need to be combined.

Before combining them, these objects need to be selected. To do this, move the cursor over the first object, left-click it (it will become highlighted), and then click the second object (it will also become highlighted). Please note that, unlike other software programs, in AutoCAD you do not need to hold down the Ctrl or Shift keys to select several individual objects, and that the Escape key must be used to cancel the selection.

With both objects selected, click Express Tools > Convert To Mtext button (this command is part of Express Tools add-on mentioned earlier):

Convert To MText button in AutoCAD

The objects will be combined into a single MTEXT object, as can be verified by hovering the mouse over it:

Tooltip for multi-line text objects

This command can also be run from the AutoCAD command line by typing “txt2mtxt” (without quotes) and pressing the Enter key.

If you have a lot of one-line text objects in your drawing that need to be combined, you can speed up the process. After you have successfully merged a set of objects using this command, press the Enter key to repeat the previous command, select the objects to be combined and press the Enter key again to combine them. Repeat as many times as needed.

Save the drawing.

You are now ready to extract text from the drawing.

5. Extracting text from a drawing with TransTools for AutoCAD

To extract text from a drawing, you must run the text extraction macro included in TransTools for AutoCAD. To do this, click Run VBA Macro button in the Applications section under the Manage tab, select the first macro called “Trans_CollectUniqueValues” from the list, and then click the Run button.

Running Extract Translatable Text macro

You will see the following dialog:

Extract Translatable Text dialog

When you select Option #1, the application extracts all the text from each layout / model marked with a checkbox. In this case, this is exactly what we need, so we just need to check the boxes for “Model” and layout “ISO A1”. If the model contains a lot of unnecessary text, then we need to use Option #2 (extracting text from selected objects). For details on how to use this option, consult TransTools for AutoCAD documentation.

By default, only unique, non-duplicated text labels are extracted from a drawing. If you need to calculate the entire amount of text including duplicates, check the “Export all text (including repetitions) for calculating statistics” checkbox. When using this parameter, you should remember the following: when TransTools imports translations back into a drawing based on a translation table which contains duplicates, it uses the translation of the latest available duplicate, which means that it ignores other translations of the same text. If your drawing contains duplicate text objects that are translated differently, you will need to correct the translation directly inside AutoCAD after translations are imported.

In Translation Table Format section, click the Modify button and make sure that Word is selected as the format, and select the CAT tool you will be using for translation. If you are not going to use a CAT tool, select “Do not prepare (no CAT tool)”.

Translation table format settings for specific CAT tools

If you want, you can also use Excel as the translation table format, however this format is not as convenient as Microsoft Word, especially if you will be using a CAT tool for translation.

To save the generated files under the same name and in the same directory as the drawing file, check “Automatically save generated table in drawing’s folder” checkbox.

Finally, click Start button. After a while, a new Word document will be created and automatically opened in Microsoft Word. Switch to Word to view the newly created document.

Sample of translation table in Word format

The document will contain a translation table with two or four columns (it will have four columns if the “Text information (layer, type)” option was selected in the “Translation Table Format” section). The Translation column will contain a copy of the text from the Source column, and this is the column you will need to translate. As you can see in the screenshot, some of the extracted labels such as “TS 3010” do not need to be translated, so you can remove them from the table before starting the translation.

You can also see the following strange rows in the table:

Example of incorrectly formatted vertical text in translation table

It is clear that these individual letters are part of a vertical label (“REVISION” where the last letter “I” is missing because it is a duplicate and the table contains no duplicates). In such cases, you will need to remove such rows from the table and translate the text directly within the drawing.

If the drawing contains complex text objects that include special symbols or formatting, the exported text will contain special codes:

  • formatting codes in dark red color (e.g. \H2x;\L);
  • code %%D to indicate a degree sign.

When the translation table is prepared for a specific CAT tool, the text that does not require translation (e.g. the text in Source column (1)) is marked with special formatting so that your CAT tool treats it as non-translatable. For memoQ, Trados Studio and Wordfast Pro, TransTools uses special styles called tw4winExternal and tw4winInternal while hidden text formatting is used for other CAT tools. At the same time, formatting codes (displayed in dark red color) are marked in such a way that the CAT tool displays them as tags.

If the first column appears to have no text when you open the document in Word, activate the display of hidden text under Word Options: switch to File tab, click Options button in the menu, choose Display section in the list on the left side, and then check “Hidden text” checkbox:

Displaying hidden text in MS Word

In case you have forgotten to combine some one-line text (TEXT) objects into multi-line text (MTEXT) objects, you can rearrange the table rows in such a way that the individual pieces of the sentence appear one after the other in the correct order, to provide better context during translation. To do this, select a row, cut it to the clipboard, and then paste it into the appropriate place within the table.

To learn about Extract Translatable Text tool and its various options, consult its documentation.

So, we have prepared the table for translation. Let us now import it into our CAT tool.

6. Importing the translation table into the CAT program

If you use memoQ, a special filter has been created for this program that allows you to turn some codes into memoQ tags. To use it:

  1. Download the following filter configuration file. In memoQ, open Resource Console and switch to Filter Configurations section. Click Import New button. Select autocad-tables-cascading-filter.mqres file, assign it a descriptive name in the dialog that pops up, and click OK button. You will not need to perform this step in the future.
  2. From inside a project, import the document using Import With Options command. Once you are in Document Import Options dialog, select Cascading Filter from the dropdown list in the Filter column, and in the next column select “AutoCAD Translation Tables (cascading)” (or another name if you renamed the filter in step #1). Click OK to import the document.
  3. Now %%D and some other special codes will be displayed as red tags.

For other CAT programs, use the default import options. Unless you use memoQ, Trados Studio or Wordfast Pro: by default, most CAT tools do not import hidden text which is exactly what we want, however if hidden text is imported in your import filter configuration, change this so that hidden text is not imported.

7. Translation inside your CAT tool

So, you have imported the translation table into your CAT tool. After following the procedure for memoQ described in section 6, we will see the following:

Translation table in memoQ

In some cases, you will need to split segments into parts using the Split / Split Segment command, or merge segments using the Join command. For example:

Joining incorrectly segmented text in memoQ

As you translate the document, make sure to transfer the tags into the translation segments correctly. However, tags <br/> (line break) and %%D (Ø sign) can be omitted if they are not needed in the translation, for example, if a line break is not required in the translation.

Be careful with special characters that are not used in the source text: en-dash (–), em-dash (—), number sign (№) and some others. These characters may be missing from the font associated with the text in AutoCAD, because drawings often use specialized, non-standard fonts. Instead of a long dash, it is best to use a standard hyphen (-) in your translation which will appear longer inside AutoCAD, and in place of a number sign (№) use Latin letter N followed by a degree sign (“N°”). You can also have issues with some accented letters.

Once the translation is finished, export the final document from the CAT tool.

8. Importing translations into the drawing with TransTools for AutoCAD

Now that the translation table is ready, all you need to do is import the translation into the drawing and correct the formatting of the drawing.

Open the drawing from which the text was extracted.

Using Tools > Macros > Macros... menu item, run “Trans_Replace” macro:

Running Translate With Translation Table macro

You will see the following dialog:

Translate With Translation Table dialog

Select the same parameters in “What would you like to process?” section as before (i.e. Option #1 – specific layouts, Option #2 – selection of specific objects on each layout / in the model).

In the Translation Table section, click [...] button and select the translated file.

Finally, click the Start button in order to replace the source text with translations. Wait for the operation to complete.

To learn about Translate Using Translation Table tool and its various options, consult its documentation.

To see how the drawing will appear after translations are imported, see blocks_and_tables_eng_unformatted.dwg (AutoCAD format) and blocks_and_tables_eng_unformatted.pdf (PDF format) from the attached ZIP archive.

9. Formatting the drawing after translation

Now that the drawing is translated, you need to perform the following operations:

  1. Check that all the text has been translated. Sometimes parts of the source text may remain untranslated if a text object contains auto-updatable fields, e.g. File Name field. Also, when you import the translations into the drawing, you may accidentally use different options compared to the options used for extracting translatable text, causing wrong text to become translated. Also, text inside embedded objects (such as Excel spreadsheets) cannot be processed by TransTools for AutoCAD, so it must be translated manually by right-clicking the embedded objects and choosing OLE > Open menu item.
  2. If the drawing contains duplicate labels that need to be translated differently, correct the translation in the drawing:
    1. To edit simple text objects, double-click them with the left mouse button and, when editing is finished, click OK button (MTEXT objects) or the Enter key (TEXT objects).
    2. To edit an attribute of a block instance, double-click the block instance, select the attribute from the list, enter a new value in the Value field and click OK.
    3. To edit text inside the block template, right-click the block instance, select Block Editor item in the pop-up menu, edit the text inside the block editor, and then click Close Block Editor button, confirming the changes.
  3. Check the text for question marks (?). They may appear because the translation uses special characters that are missing from the font assigned to the text, e.g. en-dash (–), number sign (№) and some others.
  4. Check the text for strange characters (for example, the title block of our drawing contains “ÊÎÐÈ Á.” Instead of “КОРИ Б.”). This means that you need to change the text style assigned to the text. To change the text style, find the Text Style parameter. In our drawing, we can find gobbledygook in the title block only (the title block is a block instance). To change the text style of labels within a block instance, do the following:

    1. For labels “КОРИ Б.”, “БОБ М” and “ПЛАНЫ ЭТАЖЕЙ”, double-click the label, select the appropriate attribute of the block instance from the attribute list, and then switch to Text Options tab where you will find Text Style parameter.
    2. For label “ИЗ” under label “ЛИСТ” you need to select the title block, right-click and select “Block Editor” menu item, find this label in the block editor, left-click it, then right-click and select Properties menu item, and finally change the Style parameter to Standard. After editing is finished, click “Close Block Editor” button under the Block Editor tab to return to the layout.
      Incorrectly displayed Cyrillic text

    In most cases, you can simply select Standard from the list to correct the text style.

    For one-line and multi-line text objects, the style can be updated using the Style parameter in the pop-up window that appears when the text object is selected.

  5. Format the drawing before delivery:

    • If the text does not fit within the bounds of the text object:

      1. Reduce its size using the “Text Height” parameter: select the text object to display the options window, then move the cursor over it to expand the window, and find the “Text height” parameter for MTEXT objects or “Height” parameter for TEXT objects. For MTEXT objects, this parameter can also be applied to the specified text by double-clicking the text object, selecting the text and changing the “Text height” parameter in the ribbon:

        Changing text height for an MTEXT object

        Changing text height for a table cell

      2. Shrink the width of the text (via the “Width factor” parameter) in the parameters of MTEXT object, in block attribute editor, or in the parameters of the text style applied to the object.

        Changing width factor for a block attribute

      3. Expand the boundaries of a MTEXT object: left-click the lower right corner of the text object, move the mouse pointer to a new location and then click the left mouse button again.
        Resizing an MTEXT object
    • If an object needs to be moved, select it with the left mouse button, left-click the blue square located in one corner or in the top part of the object, then move the object to another location and left-click again to “release” the object.
      Dragging a text object
    • To move right, left, up or down within the layout / model (called “panning”), hold down the mouse wheel while moving the mouse.
    • To change the display scale (zoom in or out), roll the mouse wheel away from you or towards you, respectively.

Remember that for objects located inside viewports on a layout it is better to edit them inside the Model. Editing from inside a layout (by double-clicking on the viewport) is possible only if the viewport is locked (there is a closed lock icon in the status bar when the viewport is selected).

When selecting objects, keep in mind that left-clicking adds objects to the existing selection set. Therefore, if other objects are already selected in the drawing, first press the Escape key to deselect them.

If Object Snap or Polar Tracking options discussed at the beginning of this article are activated, it may be difficult for you to move objects or change their bounds precisely. It is best to deactivate these options. However, in some cases, activating the Polar Tracking option can help you move an object straight down, up, right, or left.

Finally, our drawing is completely ready for delivery to the customer! You can see the finished result in files blocks_and_tables_rus_final.dwg and blocks_and_tables_rus_final.pdf located in the attached ZIP archive.

10. Additional self-learning material

In the future, when you translate CAD drawings, you may need the following additional information:

  • How to save CAD drawings in PDF format for sending to the customer. You can find a number of videos explaining this procedure on YouTube.
  • How to create multi-language drawings (i.e. drawings with original and translated text appearing side by side). TransTools for AutoCAD allows you to create such drawings, however it takes some time to prepare the drawing for translation. If you need help in mastering this workflow, please contact me using the contact form.

Referenced files:

Click here to download all the files referenced in this article.


I hope you are now ready to complete your first AutoCAD translation assignment with confidence. Good luck!

December 24, 2021

Add comment

Security code Refresh