I have created a drawing set with thousands of installation codes that I need to add a TM symbol to. The default font does not suppor the TM symbol. I would like to change just the installation code font to Arial and not affect all the other attributes in the project. Does anyone know of a project wide way to do this? If not project wide is there a drawing wide way? The Project wide Electrical style change changes all the fonts. I used the Find/Edit/Replace component text to insert the Unicode value for the TM symbol but the font shows it as "?".
Solved! Go to Solution.
Text styles and fonts are not my area of expertise but I think you would have to create a new text style, assign the font you want to that style, then change the attributes to that text style.
There isn't a feature that will do this without some customization. You could use the Project-Wide Utilities to run a script project-wide. The script would call a custom list program to create the new text style with the font you want and then change all the INST attributes to that style.
I've attached a zip file containing a sample script and lsp file that is a starting place on this and should work with a few changes and setup. I did very minimal testing on this so try it out on some sample drawings and make backups of all drawings before running this on them.
You will need to use a text editor like Notepad and open the chg_inst_style.lsp file and change the style name and text font to what you want. My sample uses a style called "WD_Arial" and a text font "Arial". Just edit the file and save it with your text style and font name. The lsp file has comments in it so you should be able to tell what to change.
For this to work there is a little bit of setup so that the lsp file is loaded automatically anytime a drawing is opened. First unzip the files into a folder. Then in AutoCAD Electrical do these steps -
Then to try it follow these steps -
1. Run Project tab > Project Tools panel > Utilities
2. Check the box for "Run command script file"
3. Browse to where you unzipped the files and select the .scr file
5. Select Project
6. Select the drawings to process
It should open each drawing, check for the text style and create it if it does not exist, look at each block on the drawing for an INST attribute, and change it to your text style.
Yes, I guess it would help if I actually attached it.
Here it is. Sorry about that.
I will like a generic help on the architecture of that code. I have the same problem where I want to add an attributes through the entire project without going to each component and using the add attribute command. I think a code will help if there is no other way I can do? Please let me know.
Depending on the number of components you want to do this on you could add the attribute to the component symbol in the library and then use Swap/Update Block selecting project wide to update.
I agree with Bob that adding it to the library symbol and then updating using the Swap Block is the way to go. If it is a lot of blocks you can use the Library Swap option in the Swap Block. This would be pretty complicated I think to do using a lisp function.
Yes it is through the entire wiring diagram which include many blocks. I started using the add attribute command but as you know it takes forever. Please let me know?
Also, How do yo change the line reference for the entire project?
As I said I don't think adding attributes using a lisp function would be an easy thing to do. I still recommend adding the attributes to the library symbols themselves and then using the Swap Block to update the entire project in one command. The other advantage to this method is that any time you insert these blocks in the future they will have the added attributes. Adding them on a block already inserted only adds it to that instance.
If you have anyone there who can write scripts it might be possible to write a script to insert the attribute definitions on the library symbols using the -ATTDEF command. If you are always inserting the same attribute definition, in the same location, with the same values. Once the script has been tested on one library symbol you could create a project containing the library symbol drawings and use the AcadE Project-wide Utilities to run the script across the project. Make a backup copy of the library symbols before doing this just in case you run into any problems.
Regarding line references, if you mean the ladder line references you can use the Renumber Ladder Reference command or the Project-wide Update/Retag.
By the way, I would recommend starting new posts when you ask new questions. You may get different people weighing in on the new question than the original one.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.
|AutoCAD Land Desktop|
|AutoCAD Plant 3D|
|AutoCAD Raster Design|
|AutoCAD Structural Detailing|
|Ecotect Analysis - Desktop Tools|
|Green Building Studio - Web-Based Service|
|Robot Structural Analysis|