AutoCAD Express Tools

AutoCAD Express Tools

Reply
Contributor
Dropkickbob
Posts: 22
Registered: ‎04-12-2013
Message 1 of 2 (664 Views)
Accepted Solution

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

664 Views, 1 Replies
07-15-2013 01:32 PM

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,

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. :smileyhappy:

Contributor
Dropkickbob
Posts: 22
Registered: ‎04-12-2013
Message 2 of 2 (662 Views)

Re: can you make a field to show only part of the filename?

07-15-2013 01:40 PM in reply to: Dropkickbob

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. :smileyhappy:

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.