Trim Attribute String

Trim Attribute String

Anonymous
Not applicable
1,087 Views
4 Replies
Message 1 of 5

Trim Attribute String

Anonymous
Not applicable

Hello Forum, Is there any way to trim parts of a string used in an attribute? I want to have an attribute that is the name of the file without the last four characters and I also want an attribute that displays just those four values from the sheet title. I am new to CAD so please let me know if this is possible or not. 

0 Likes
1,088 Views
4 Replies
Replies (4)
Message 2 of 5

jseefdrumr
Mentor
Mentor
If this is possible, it would only be accomplished via some sort of coding. ACAD, and therefore ACADE, supports multiple programming languages for customization. LISP and VisualBasic are the old-school tools. I'm old-school, so not sure what else is available.

That said, if you're new to CAD in general, this probably isn't a thing to try and customize. Making something like this work within our software would require not only some coding skills but also a pretty deep knowledge of how ACAD works.

Jim


Jim Seefeldt
Electrical Engineering Technician


Message 3 of 5

Icemanau
Mentor
Mentor

Depends on what you want to display...

 

If you are talking about the filename extension (.DWG for a dwg file) then there are a couple of methods.

I use a field in the dwg that automatically updates.

 

There is also a method in the Title block Update to choose which style of filename to display but requires the Title Block Update to be run.

 

 

For the Field method this is what you do.

Start the insert text using the method you prefer (single of multi line) and right click in the text entry box.

Select the Insert Field command from the menu and then select the field you want to insert from the list.

When you select the Filename as the field to insert, there is a checkbox of to the right of the dialog box.

This checkbox is to display the filename extension which is what I believe you want to hide.

 

It is selected by default, so just remove the check and you should just get the filename without the dot and extension.

 

If however you want to show a separate part of the filename itself, then as was stated, you will need to do some lisp programming or look at the field names that are available to be inserted.

 

Regards Brad

>

Brad Coleman, Electrical Draftsman
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 5

Anonymous
Not applicable

Thanks for the feed back. I am a very proficient coder so I will look into doing this with VBA!

0 Likes
Message 5 of 5

jseefdrumr
Mentor
Mentor
Be sure to review all the info you can find on how AutoCAD Electrical manages its attributes. I would just caution that whatever you do, avoid making changes to attributes that ACADE uses for other functions. Extracting the info is one thing, but if you change an attribute - its value or its name - you may get some unexpected results.

I've never heard of anyone 'parsing' an attribute to separate its characters. You may find additional help for this on the customization forums. They aren't specific to any one version of ACAD, so people there may not be able to assist with Electrical-specific questions. But there's a lot of knowledge over there on forcing this software to bend to your will in all sorts of creative ways.

Good luck,
Jim


Jim Seefeldt
Electrical Engineering Technician


0 Likes