Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto Populate Revision level based on name of the file

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
AARON.RISTAU
522 Views, 11 Replies

Auto Populate Revision level based on name of the file

I am looking for some help (if possible) with auto populating the "REV #" line in the "Enhanced Attribute Editor" with the revision of the name of the file. The files always get saved as     " xxxxxx-rev. A"  ect.   Is there a way to take the revision from the name of the file and input it into the revision. It seems trivial to just add it but this ensures there are no mistakes.  see below 

AARONRISTAU_0-1649257138640.png

 

11 REPLIES 11
Message 2 of 12
pendean
in reply to: AARON.RISTAU

That attribute needs to be a FIELD: start that FIELD command name and look for what you want to point to there.
Message 3 of 12
user181
in reply to: AARON.RISTAU

Do you want it to show just the last letter of the drawing name?  If so you can make it a field and choose DieselExpression as the field type and use $(substr,$(getvar,dwgname),$(-,$(-,$(strlen,$(getvar,"dwgname")),4),1),1) as the expression.  

EESignature


Message 4 of 12
AARON.RISTAU
in reply to: user181

Yes correct just the "A" or "B" or what ever it might be
Message 5 of 12
user181
in reply to: AARON.RISTAU

Then like I stated in my last post make it a field and choose DieselExpression as the field type and use $(substr,$(getvar,dwgname),$(-,$(-,$(strlen,$(getvar,"dwgname")),4),1),1) as the expression.  

EESignature


Message 6 of 12
user181
in reply to: AARON.RISTAU

@AARON.RISTAU when in the attribute editor instead of entering text in the value right click and select Insert Field.  Then in the dialog box under Field category select All and then under Field names select DieselExpression and then on the right side paste the expression $(substr,$(getvar,dwgname),$(-,$(-,$(strlen,$(getvar,"dwgname")),4),1),1)

 

diesel.png

EESignature


Message 7 of 12
AARON.RISTAU
in reply to: user181

AARONRISTAU_0-1649266999806.png

 Thank you for your help. I input the script into the Deisel pushed ok but nothing saves so it just comes up blank

Message 8 of 12
user181
in reply to: AARON.RISTAU

Maybe you did something wrong. Try again and if it still doesn't work maybe you can post the drawing file here. 

EESignature


Message 9 of 12
pendean
in reply to: AARON.RISTAU

@ AARON.RISTAU Did you edit the attribute default in your block? Show us your step by step in a video please, this is a good free recorder from Autodesk https://knowledge.autodesk.com/community/screencast

Message 10 of 12
user181
in reply to: AARON.RISTAU

@AARON.RISTAU   Sorry I wasn't thinking right, I messed up the expression,  I should have tested it. Try this:

 

 $(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,"dwgname")),4),1)

EESignature


Message 11 of 12
AARON.RISTAU
in reply to: AARON.RISTAU

I am not sure why but I restarted my computer and it updated finally. thank you for all your help

 

 

Message 12 of 12
user181
in reply to: AARON.RISTAU

Probably not your computer. I did the expression wrong the first time. Make sure to use the last one I posted. 

EESignature


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report