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

AutoCAD - can you make a field to show only part of the filename?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
draftorb
4978 Views, 4 Replies

AutoCAD - can you make a field to show only part of the filename?

Basically we set up our file names with a # and the title of the drawing. I want to create a field that only shows the number thats in the file name.

 

Example: 

if the filename is "10101template.dwg", i  only want the 10101 to show up in my field.

 

is there a diesel expression or something along those lines that would chose only the first 5 characters in the file name? (our job numbers are 5 #'s long and are the beginning portion of the filename).

 

if not, is there an expression that would show all numbers in the file name?

 

I realize there are a few simliar posts, but I haven't found exactly what i am trying to do, but if i do find a solution elsewhere, i will post it here. 

 

Thank you,

 

[ The subject line of this post has been edited to include the product name by @handjonathan ]

4 REPLIES 4
Message 2 of 5
draftorb
in reply to: draftorb

doubt anyone will read this, since i solved my own problem very shortly, but if you're curious, the solution is the diesel expression:

 

$(substr,$(getvar,dwgname),1, 5)

 

The 1 means the first character of the field.

 

Then 5 obviously means the 5th character. 🙂

Message 3 of 5
jagostinhoCT
in reply to: draftorb

This was exactly what I was looking for!

Very useful.

 

Thanks for posting the solution.

 

 

Assistant BIM/CAD Manager

Manchester, UK


Message 4 of 5
esaldana
in reply to: draftorb

Thanking you, just few years later 🙂
Message 5 of 5
fstechUWW4U
in reply to: draftorb

Still useful!

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

Post to forums  

Autodesk Design & Make Report

”Boost