Sunday, 23 January 2011

CAD to CAT and Back
Introduction
This article describes a workflow for translating the text in AutoCAD drawings without buying an AutoCAD license. It is also applicable on other graphical formats that can be converted to dxf (Drawing Interchange Format). The translation tool in this example is SDL TRADOS Studio, but the method, with minor modifications, is possible to use also with other CAT (Computer Aided Translation) tools, as the translatable format is txt.
Programs needed
CAD program
AutoCAD (developed by Autodesk) produces a file format called dwg. For transfer to other programs, Autodesk also developed a format called dxf, (Drawing Interchange Format). There are also other CAD programs on the market that can edit and convert the dwg and dxf formats. In this example I use a program called progeCAD Professional that costs € 291, developed by ProgeSOFT. If you can get your customer to save the drawings in dxf format, you actually do not have to buy neither AutoCAD nor progeCAD for the translation work. But, I would strongly recommend to buy a CAD program or a program that at least can read dxf, else you are unable to see the result of your work. And, you cannot verify the conversion results.
Conversion program
The conversion to and from the translatable text format (.txt) is done with a conversion tool called TranslateCAD from TranslationToSpanish.com and actually only costs $ 29 which is a very low price considering they also have free support for the program! The converter is a standalone program and not integrated in the CAD program, thus you only need a dxf file for input.
Text Editor
As there is a glitch in the back conversion to text from SDL Trados Studio, you also need a good text editor that can convert the txt format. For this conversion I use EditPad Pro that costs 40 €.
Workflow
The workflow is based on a real case where I translated 37 dwg drawings. The workflow starts with the source files saved in a folder named DWG_source
Step 1 - Convert dwg to dxf
The converter needs a dxf for input.
Open progeCAD professional and open the files.
Save As, choose AutoCAD 2010 ASCII.dxf (binary does not work in the converter)
Save the dxf files in another folder DXF_translate
Step 2 - Convert dxf to txt
Open TranslateCAD. In the left upper pane, choose the folder DFX_translate. Select all files in the lower left pane.
Push Extract text!
You should now see a Status window that shows
The target files were successfully created.
The converter has now produced two files for every source dxf. They have the extensions -trans1.txt and -trans2.txt. The translatable file is -trans1.txt, and this can be opened in Studio or another CAT application, or actually even edited manually in the text editor. If there are a lot of files it is a good idea to copy the trans1 files to another folder for translation.
Step 2.5 - Optional: Filtering with Regular Expressions
I recommend to use filters when importing, this is explained in a separate blog posting.
Step 3 - Translate with Studio
Optional: file merging
If you have many files, which is typical in a drawings translation project, it would be nice to have all drawings in the same file. Drawings also tend to contain a lot of repetitive standard texts, thus it is easier to handle in a single file. That is easy to achieve (but optional) in Studio. Use New project, which starts the project wizard. When you come to the Add files pane, first add the files, then select all files with Ctrl+A, push Merge Files. Name the file AllDraws.
The merge function will produce a single file of all drawings. Now open the file in the Studio editor. Note that it is till is easy to see in which individual drawing you are working, as the drawing name is highlighted in the list in the Editor pane to the left of the dual editing window. To expand the Editor window, if you do not see the file names, click the double arrow.
Note that Studio changes the scale figures, like Scale 1:10 to 01:10. (Do not ask me why). This leading zero must be removed manually.
Step 4 - Save As Target
In a merged file, you cannot save as target from the dual editor. Change to the Files pane, right click the merged file, choose Batch task/Generate target translations. That produces individual files for every drawing.
Step 5 - Convert to correct text format
This step is necessary only if you use Trados Studio. That is because Studio saves back the text files as Macintosh-formatted text, which cannot be converted in TranslateCAD! It is now you need your text editor, e.g. EditPad Pro. Open the trans1 files. Click to open the Convert menu. You now see, that the To Macintosh is greyed out, which means you have a genuine Macintosh file. Now click on To Windows (CR LF). Now the To Windows should be greyed out, indicating that the file is back in Windows format. Save the file, and exit EditPad. I suppose this could be done in any proper text editor. Note: If you by mistake use the Mac format, you do not get any error message in TranslateCAD. The error shows when you try to open the dxf in progeCAD!
Step 6 - Copy the translated trans1 to the source folder
First, make a copy of the folder DXF_translate, where the source dxf, trans1 and trans2 files are. Then, copy (and replace) with the translated trans1 files from your Studio project folder. The source trans2 and the translated trans1 must be in the same folder to run the back conversion. That is why it is important to make the copy of the source folder; if anything goes wrong you must be able to start again from the source trans1 texts.
Step 7 - Create translated dxf files
Open TranslateCAD, now use the right side panes. In the upper pane, locate the DXF_translate folder. You should now see all of the -trans1.txt files. Select all files and push Re-construct. It happens that you get the message "The target file is already open by another application. Please close it and try again." and that happens even if progeCAD is closed. I think that this error has something to do with the trans1 files, and a remedy that works is to delete all the trans1 files in the folder DXF_translate and the copy them again from your Studio project folder. You also might have an error message in progeCAD next time you open it after this error, but just click it away.
The converter produces new dxf files, that are named -trans.dxf, the source dxf are not overwritten.
Step 8 - Create the translated dwg
Open progeCAD (clicking on dxf does not work) and open the -trans.dxf files. Note that you have to change file type to dxf in the file format dropdown, else you will only see dwg files. You can now check your translation and formatting in progeCAD, and then Save As... and select AutoCAD 1010.dwg (AutoCAD 2007 seem to be the default).
Editing in progeCAD:
To move the drawing in the pane, push and hold down the scroll wheel on the mouse, and then drag. The scroll wheel zooms in and out in the drawing. And, you have all CAD functions available to edit the drawings if needed.
Thanks to
Paul Filkin, SDL, for help with regular expressions and text format.
Vicente Victorica, TranslationToSpanish.com, for fast support on the Mac file problem.

2 comments:

  1. Being a robot engineering expert helps a lot, evidently.

    ReplyDelete
  2. "Note that Studio changes the scale figures, like Scale 1:10 to 01:10."
    This has to do with settings in the Translation Memory. If you work with tech text, untick Recognize times. Also untick Recognize dates, if you get problems with header numbers 1.2.1020 interpreted and converted to date format.
    Reino

    ReplyDelete