I’ve been seeing a lot of chatter on the internet about providing drawings in multiple languages. You may have noticed I touched upon this topic in my previous blog on
Dictionaries and in one of the comments I was asked to elaborate a bit on how to use dictionaries and Xrecords to make this happen.
First, I feel the need to state this disclaimer; using the technique described in this blog will not translate English text to Spanish text or any other language automatically, you need someone that knows the languages to help set the text in each language. Also, the number of languages that can be stored in a drawing is up to the user.
As I mentioned in the
Xrecord blog and the
Dictionary blog, there is nothing available ‘out of the box’ to use these tools. These data containers must be implemented with the use of lisp and/or dot net. I recommend dot net for any AutoCAD version 2007 and newer. I would say that dot net is about 4 times faster than lisp and 100 times faster than VBA. You would notice the speed difference when you switch languages, especially for large drawings.
The following is a description in a step-by-step process for using dictionaries and Xrecords to create a drawing in multiple languages:
1.) The first thing you need to decide is how many languages you want to use in your drawing. The number of languages will be the number of Xrecords you will need per extension dictionaries.
2.) You need to build your set of tools to handle these different languages.
3.) You need to create an individual command that will set an extension dictionary and the Xrecords to each entity that holds text (dbtext, mtxt, dimensions, etc....) and set the current language text to the Xrecord.
4.) You need to create a command that will scan a whole drawing and set the extension dictionary and Xrecords to the text entity.
5.) You need to create a command that will display a dialog box that allows a user to add the text to each Xrecord. Note: This is where you would edit your different languages.You need to create a command that allows user to select what language to display in the drawing. Actually, this data would get stored in the NOD, the main dictionary of the drawing file.
Through the use of dictionaries and Xrecords you will keep your drawing much cleaner. If you move the text the languages will follow. It is much cleaner and user friendly than trying to manipulate with layers. There are more items that could be built into this, such as an interference check (some languages will require longer text strings) or create a batch routine to change a folder of files to the new language to display or set the dictionaries and Xrecords.We have all the logic to do this within our framework. There is so much more you can do and of course, we need to take into consideration that each company will want to add their own touch to this.
Feel free to contact us if you would like a collection of commands to work with your language issues in your drawings.
Patrick K. Johnson
Labels: Autocad, blog