Collect unique text |
 |
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 Multiple Replace 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 table as a replacement list. After you finish translating the second column of the replacement list (manually or using CAT software), you use Multiple Replace 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 Multiple Replace;
- Formatting codes are specially formatted to make it easy to differentiate between them and translateable text. Most formatting codes are marked with DO_NOT_TRANSLATE style in Microsoft Word replacement lists, 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 replacement lists (optionally add layer or object type information).
Running the command
Collect Unique Text is launched from Autocad's Macros dialogue. Click here for more information on how to do it.
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 tagging the Excel or Word file. Save the translation as a new document and paste its first column into the second column of the original replacement table.
Options:
-
Select one of the options depending on where the text is located:
-
Option 1 - Current drawing file (default) - choose this option if you want to extract all text from specific layouts of the current drawing or process a single selection within a single drawing layout.

Layouts - to extract text from one or several layouts, make sure that the 'Layouts' option button is selected and check (tick off) the appropriate layouts. Use All and None buttons to check or uncheck all layouts at once.
Selection - to process a single selection in the current drawing, make sure that the 'Selection' option button is selected, then select the appropriate layout that contains the objects (to process text in a viewport, select 'Model'), and click Select button. When you do, the dialogue will temporarily disappear and you will be able to select the desired text.
There are several ways to select objects:
- Left-click at the top-left corner of the selection, a small distance away from the very top-left object that you want to include in the selection. Hold the left mouse button and drag the mouse until the selection fully covers all the text objects, and then release the left mouse button. You may use the mouse wheel while dragging the mouse in order to zoom in/out.
- Left-click on individual objects to add them to the current selection set.
- 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.
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).
-
Option 2 - Multiple selections from current drawing file - 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.

Select the appropriate layout from the drop-down list and click Select Objects... to select specific objects on this layout (see Option 1 above for guidelines on selecting objects) 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.
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.
-
Option 3 - Open drawing files - this option allows batch processing of several drawings opened in Autocad.

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.
-
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 Replacement operation. However, sometimes you may need to put text back in the drawing manually, i.e. without using Multiple Replace command (for example, your company has a large drafting department with people who are responsible for this). In such cases, click this option.
-
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.
-
Process specific layers only: Use this option if you need to translate text that is located in specific layer(s).

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.
-
Exclude text objects matching specific conditions: Use this option if you would like to skip objects whose text satisfies certain conditions. E.g., you do not want to translate equipment numbers like 'PT-289' or line numbers like '067-DDD-056-D28', etc.

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 Replacement List.
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.
-
Replacement List format: the format of the replacement list generated by this command can be configured.

Click Modify to change the replacement list format settings.
You can choose whether to export the replacement list in MS Word or MS Excel format, whether or not to print the full path to the processed drawing (in addition to the file name), and whether or not to export additional information on extracted text (layer and type of object, i.e. TEXT, TABLE CELL, DIMENSION, etc.).
---
When the appropriate options have been selected, click Start. To exit, click Close.
When the replacement list 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 Multiple Replace command). When you translate the replacement list, do not touch these codes unless you know how to remove them and you find them unnecessary (e.g. you can remove \P and <br> which mean a paragraph break and a line break, respectively).
Here is a list of codes you can remove or add depending on context:
- \P - paragraph break;
- <br> - line break;
- <tab> - tab character.
Update for version 1.1.0 and higher: If you output the replacement list into Microsoft Word, most formatting codes will be marked using character style 'DO_NOT_TRANSLATE'. If you use SDL Trados to translate the replacement list, these formatting codes will turn into placeables, similar to numbers and dates. It will be easier to translate the text and your Translation Memory will become more efficient.
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 replacement list.
Conditions (masks) are defined using Microsoft 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:

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 Replacement List.
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 replacement list manually than to create 'loose' conditions that can skip translateable text.
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 Collect Unique Text dialogue after you generate a replacement list.
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.
|