AutoCAD Express Tools

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

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

584 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,

Contributor
Dropkickbob
Posts: 22
Registered: ‎04-12-2013
Message 2 of 2 (582 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:

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community