* Logo
* Translator Tools
*
* Motto
* *
TransTools suite Other software Knowledge base Feedback Back to Index | Site map
*
*
*
*
**
***
***
*
*
*
*
Also on:

TransTools on Twitter TransTools on Google Plus TransTools on LinkedIn TransTools on Scoop.It!
*

Extract Translatable Text

Autocad
Category: TranslationBack to Translation commands section

This command is designed to extract text from drawings in order to speed up translation of repetitive information (e.g. notes, holds, equipment descriptions, labels, etc). Combined with Translate using Translation Table command, it will dramatically improve your translation speed and quality when dealing with Autocad drawings.

How it works?

This command processes drawing layouts or user selections and extracts all unique text from drawing objects (including TEXT, MTEXT, TABLE, DIMENSION, MULTILEADER and EXTERNAL REFERENCE objects). All this text is then output into a Microsoft Excel or Microsoft Word document as a translation table. After you finish translating the second column of the translation table (manually or using CAT software), you use Translate using Translation Table command to merge the translation back into the drawing.

Features

  • Process multiple layouts in the current drawing and/or multiple selections within the current drawing;
  • Batch-process multiple drawings opened in AutoCAD;
  • Support for TEXT, MTEXT, TABLE, DIMENSION, MULTILEADER and EXTERNAL REFERENCE objects;
  • All text is sorted by coordinates in top-to-bottom, left-to-right order (by X, Y and Z coordinates);
  • Text is extracted with formatting codes, making it easy to preserve formatting when the text is imported back into drawings with Translate using Translation Table;
  • Formatting codes are specially formatted to make it easy to differentiate between them and translatable text. Most formatting codes are marked with DO_NOT_TRANSLATE style in Microsoft Word translation tables, which is handy for Computer-Aided Translation users;
  • Option to process specific layers only (e.g. if the text you need to translate is in 'TXT_EN' layer);
  • Option to process text only (i.e. text objects containing letters as opposed to digits, punctuation marks, etc.);
  • Option to exclude text based on specific conditions (e.g., to ignore text like 'LG-123-456');
  • Configure the format of translation tables (optionally add layer or object type information).

Running the command

Extract Translatable Text is launched from Autocad's Macros dialogue. Click here for more information on how to execute the macro.

Tips for CAT software users

Many drawings contain slightly different text. Using TransTools for Autocad in conjunction with CAT software, you will be able to speed up translation even further. For ease of use, remove the first several rows and the third column before importing the Excel or Word file into your CAT tool. Save the translation as a new document and paste its first column into the second column of the original translation table.

Options

Screenshot: Extract Translatable Text dialogue

  1. Select one of the options depending on where the text is located:

    1. Option 1 - Full Layout(s) (default) - choose this option if you want to extract all text from specific layouts of the current drawing.

      Screenshot: Extract Translatable Text option 1

      Check (tick off) the appropriate layouts. Use All and None buttons to check or uncheck all layouts at once.

    2. Option 2 - Selection(s) - choose this option if you would like to process multiple selections or layouts in the current drawing. This should be useful if your drawing has viewports and only portions of text need to be translated.

      Screenshot: Extract Translatable Text option 2

      Select the appropriate layout from the drop-down list and click Select Objects... to select specific objects on this layout (see below for more information) or Select Layout to select everything on this layout. Each selection will be added to the list below, so you will be able to select as many layouts or selections as you want.

      Selecting objects:

      When you click Select Objects..., the dialogue will temporarily disappear and you will be able to select the desired text.

      • Left-click at the top-left corner of the area you want to select, a small distance away from the very top-left object that you want to include in the selection. Then, move the mouse down and to the right until the selection fully covers the text objects, and then release click the left mouse button again. You may use the mouse wheel while dragging the mouse in order to zoom in/out on a specific area of the drawing.
      • Left-click at the bottom-right corner of the area you want to select, move the mouse up and to the left until the selection at least partially overlaps all text objects you want to select, and then click the left mouse button again. With this selection method, unlike the one above, you only need to select a part of a text object and it will be included in the selection.
      • Rotate the mouse wheel up or down to zoom in/out. While you do this, try to move the mouse closer to the objects you want to center the view on.
      • Left-click individual objects to add them to the selection set.
      • Hold down the Shift key and left-click individual objects to remove them from the selection set.
      • Hold down the mouse wheel and move the mouse cursor in any direction to scroll (pan) up/down/left/right.
      • Double-click the mouse wheel to zoom the drawing to its extents (i.e. zoom the screen to include the entire drawing).

      Press Escape if you have selected wrong objects and would like to start again (this will return you to the Options dialogue). Press Enter when you have fully selected all objects to process (this will return you to the Options dialogue).

      To remove a specific selection you made, select the item from the list and click Remove. Click Clear to remove all items if you would like to start from scratch.

    3. Option 3 - Many drawings - this option allows batch processing of several drawings opened in Autocad.

      Screenshot: Extract Translatable Text option 3

      In the list you will see layouts of every drawing currently opened in the same AutoCAD application window (i.e. all drawings you can see under AutoCAD Window menu).

      Check the appropriate layouts manually or click All / None buttons to check or uncheck all layouts at once.

  2. Extract all text (including repetitions) for calculating statistics: By default, only unique text is extracted from the drawings. However, if you need to calculate the amount of text for charging your clients, you need to see all the translatable text, including repetitions. To do this, check this option. Note: when you use Translate using Translation Table command to translate the drawing based on such translation table, only the first occurrence of each repeating entry will be used for translation, all others will be ignored.
  3. Export basic formatting only: By default, meaningful text is extracted along with format codes that control the formatting of Autocad objects. This allows to restore the original Autocad formatting during the Translation operation. However, sometimes you may need to put text back in the drawing manually, i.e., without using Translate using Translation Table command (for example, your company has a large drafting department with people who are responsible for this). In such cases, click this option.
  4. Extract text only: If this option is checked (default), the program exports only text containing alphabetic letters. If it encounters text that contains only numbers, punctuation characters or special symbols, it skips such text. If you want to process all text, including fully numerical text, etc., uncheck this option.
  5. Process specific layers only: Use this option if you need to translate text that is located in specific layer(s).

    Screenshot: Layer filter

    When you select this option, you will see two lists.

    The left-hand list is the list of layers that need to be processed. If this list is empty, all layers will be processed.

    The right-hand list contains all layers within the current drawing.

    Click <-Add to add a specific layer to the list of layers you want to process (left-hand list). In batch-processing mode, you can also use Add custom button to add a layer that is not present in the current drawing. Click Remove-> to remove a layer from the list of processed layers.

  6. Exclude text objects matching specific conditions: Use this option if you would like to skip objects whose text satisfies certain conditions (specified by a regular expression). E.g., you do not want to translate equipment numbers like 'PT-289' or line numbers like '067-DDD-056-D28', etc.

    Screenshot: Exclusion filter

    When you select this option, you will see a list of 'masks', or conditions. There is one default condition that excludes equipment tag numbers like 'PT-255', 'L-2455', etc from the Translation Table.

    Click Add to add a new condition; Edit to modify a condition from the list; Remove to remove a condition; To Clipboard to save all conditions to the clipboard for use later; From Clipboard to import conditions that were created earlier.

    For more information on creating such conditions, refer to the conditional filter section at the bottom of this page.

  7. Translation Table format: the format of the translation table generated by this command can be configured.

    Screenshot: Translation Table Format properties

    Click Modify to change the translation table format settings.

    You have the following options:

    1. Format: Word or Excel.
    2. Include file path: this prints the full path to the processed drawing inside the translation table for easy reference.
    3. Include text information: this exports additional information on extracted text (layer and type of object, i.e. TEXT, TABLE CELL, DIMENSION, etc.).
    4. Prepare for CAT tool (Word format only): use this setting to prepare the translation table for importing into a CAT tool. You have several options:
      • Do not prepare (No CAT tool) – Use this option if the translation table does not need to be prepared for a CAT tool. If you use a CAT tool, the best way to translate the table is to copy the Translation column into a new document, translate the document, and then paste the translated cells over the cells in the Translation table so that you have source and translation side by side.
        This is the default option.
      • SDL Trados Studio, memoQ, Wordfast Pro, Wordfast Classic – If you use one of these options, TransTools will use tw4winExternal style to hide non-translatable parts of the table (i.e., instructions, heading row, original column and columns with extra information) and tw4winInternal style to mark formatting codes as non-translatable text. These options are recommended if you use one of these CAT tools. The translation table can be used inside your CAT tool without any extra preparation. After the translation table is translated and exported from your CAT tool, you can use it to merge translations into the drawing without any extra steps.
      • Memsource Cloud, Déjà Vu X3, Cafetran Espresso, CAT tool with hidden text filtering support – If one of these options is used, TransTools will use hidden font formatting to hide non-translatable parts of the table and hidden font formatting to mark formatting codes as non-translatable text. The translation table can be imported into your CAT tool without any extra preparation. When you import it into your CAT tool, make sure that hidden formatting is ignored in the file import settings.
      • Other CAT tool – When this option is selected, no extra formatting is applied to the translation table (besides special formatting of the formatting markers), so it is recommended to copy the Translation column into a new Word document, translate this document in your CAT tool, and then paste the translated cells over the cells in the Translation column before copying source and translation columns to the clipboard.
    5. Automatically save generated table in drawing's folder: if you check this box, TransTools will save the generated Word document automatically under the same location as the current drawing (with the same file name but with DOCX/DOC extension). This is possible if you use Option 1 (Full Layouts) or Option 2 (Selections).

---

When the appropriate options have been selected, click Start to generate a translation table which will be opened inside Microsoft Word or Excel (and saved if the appropriate option is activated). To exit, click Close.

When the translation table is created, you will see a notification. If any text was excluded using the conditional filter (item 5 above), you will see View Exclusions... button. When you press it, you will see all text that was skipped due to the conditional filter. Review this list to make sure your conditional filters work as intended.

Formatting

When the drawing is output into Microsoft Word or Excel, you will see specially formatted codes inside the text. These are Autocad formatting codes and special codes used by TransTools for Autocad. Show example
Original text:
This is standard text
This is bold text
This is italics
This is pink text

Extracted text:
\A1;\pxsm1,qj,t62;This is standard text\P\ps*,q*,tz;{\fVerdana|b1|i0|c0|p34;This is bold text\P\fVerdana|b0|i1|c0|p34;This is italics\P\fVerdana|b0|i0|c0|p34;\H1.4x;\C6;This is pink text}

These codes are very important, since they are used to restore the original formatting when the translated text is merged back into the drawing (with Translate using Translation Table command). When you translate the translation table, do not touch these codes unless you know how to remove them and you find them unnecessary (e.g. you can remove \P which means a line break).

Here is a list of codes you can remove or add depending on context:

  • \P – line break
  • %%D – degree symbol

Update for version 1.5 and higher: Starting with version 1.5, TransTools can prepare the translation table (in Word format only) for translation inside a CAT tool. For SDL Trados Studio, memoQ and Wordfast Pro / Classic, it uses tw4winInternal for AutoCAD formatting markers. For CAT tools that can skip hidden formatting (Memsource Cloud, Déjà Vu X, CafeTran Espresso, among others), it useshidden font formatting instead. This way, formatting markers are converted into tags inside your CAT tool, making them easier to handle during translation and enabling tag verification inside your CAT tool or an external QA tool.

memoQ

For memoQ users:
If you use memoQ, I have prepared a special import filter for you which will make it easier to translate the generated translation tables in Word format. In addition to handling AutoCAD formatting markers, it also converts additional codes (\P, <br>, <tab> and %%D) into blue memoQ tags. Follow these instructions to obtain and use the import filter:

  1. Download the filter.
  2. In memoQ, open the Resource Console and switch to Filter Configurations section.
  3. Click Import New.
  4. Choose the downloaded “autocad-tables-cascading-filter.mqres”, optionally rename the filter in the next window and click OK. In the future, steps 1–4 will not need to be performed because the filter will now reside in your memoQ configuration.
  5. In your project, load the translation table document using Import With Options command. You will see Document Import Options dialogue. For the document, choose Cascading Filter in the Filter column, and “AutoCAD Translation Tables (cascading)” from the Configuration column. Click OK to import the document.
  6. Now \P and %%D codes will be shown as blue tags, while formatting codes will be shown as pink tags ({0}).

Conditional filter

Conditional filters (under 'Exclude text objects matching specific conditions') provides you with a lot of control over what text is extracted from a drawing.

When a condition matches the entire text of an AutoCAD object (like MTEXT, table cell, DIMENSION, etc.), such text will not be added to the generated translation table.

Conditions (masks) are defined using VBScript Regular Expressions syntax. For more information on how to create custom conditions, click here.

When you click Add or Edit buttons in the conditional filter (item 5 above), you will be presented with the following dialogue:

Screenshot: Exclusion editor

Enter the name of the condition in the Name field.

The condition itself must be entered in the Mask field. A condition is composed of segments that match a number of characters in the text. For example, 'C' matches letter 'C', and C{2,3} matches 2 or 3 letters 'C' in a given position within the text. If all segments sequentially match parts of the complete text, the condition matches the text and this text will be excluded from the Translation Table.

The Exclusion Condition Editor provides a rather basic interface for constructing conditions, but it should be adequate for most users:

  • Letter(s): click this button to insert a letter, either an English letter or any letter from any alphabet. Specify how many times this letter can occur in the position within the complete text. Click Insert to insert the segment in the condition at the position of the caret;
  • Digit(s): click this button to insert any digit (0-9) or one of specific digits;
  • Character(s): click this button to insert any character or one of specific characters (including punctuation, special symbols, etc.).

Here are some examples of conditions that may come in handy:
[0-9]{3}\-[a-z]\-[0-9ABC/]{3,9} - this condition matches equipment numbers like '040-H-001A/B/C';
40(\-[A-Z0-9]{1,5})+ - this condition matches line numbers like '40-AM-50-50012-J10A';
(AG|UG) - this conditions matches 'AG' (aboveground) or 'UG' (underground)
[a-z]{2} - this conditions matches 2-letter tag numbers like 'LG' (level gauge), 'PT' (pressure transmitter), etc.

Be careful, it is better to remove unwanted rows from the generated translation table manually than to create 'loose' conditions that can prevent some translatable text from being added to the translation table.

To test the expression you created, type the text you want to skip. If you see 'Text matches mask', your condition should be complete. However, make sure your condition works correctly by clicking View Exclusions button at the bottom of Extract Translatable Text dialogue after you generate the translation table.

Click Save to save the condition, or Cancel to exit without saving changes.

For more information on Microsoft Regular Expression syntax used to construct conditions, refer to this page.

Developed by Stanislav Okhvat, 2007–2017

Microsoft Word®, Excel®, PowerPoint® and Visio® are registered trademarks of Microsoft Corporation.
Autocad© is copyright of Autodesk, Inc.
SDL Trados® (including SDL Trados Studio, Trados Workbench, TagEditor and Microsoft Word Addin) is a registered trademark of SDL plc.
memoQ is copyright of Kilgray Translation Technologies.
Wordfast© is copyright of Yves Champollion.

Software disclaimer