Jump to content

Get part of dwg file name and write it on a inside attribute block.


CafeJr
 Share

Recommended Posts

:unsure:

 

Hello Guys,

 

I have a doubt, someone knows if has some Lisp to get the last digits (specified - user input) of a dwg file name (in Windows explorer) and write it on a specific attribute name on a internal block.

 

Eg.: I have a folder with 600 pages dwg files, so, the last numbers of it is a specific item to show the page number of that file, it's possible read these numbers and write in an attribute inside dwg to correct the page index.

Link to comment
Share on other sites

I was going to say that SLW210 helped me with this a little while back and I'll look for the thread but I don't need to as he has already posted the link.

Link to comment
Share on other sites

I was going to say that SLW210 helped me with this a little while back and I'll look for the thread but I don't need to as he has already posted the link.

 

dbroada - Do you have a Lisp that can help with it?...

Link to comment
Share on other sites

No LISP required - just use a FIELD for your default attribute value. When you set up the field one of the options is to add a diesel expression.

 

I can't help you more than that as I am off work atm and don't have access to AutoCAD.

Link to comment
Share on other sites

dbroada,

 

 

I got it, the idea, but I can't found the location to write the specific function to put it in a Field of attribute. Can you write it? What type of attribute could be used to do it?...

 

 

Thanks again!...

Link to comment
Share on other sites

Right Click in the Attribute Editor Value box and select Insert Field.

Field Category = Other > Field Names = Diesel Expression > Diesel Expression goes in area to the right labeled Diesel Expression.

Diesel Expression Field.jpg

Link to comment
Share on other sites

Right Click in the Attribute Editor Value box and select Insert Field.

Field Category = Other > Field Names = Diesel Expression > Diesel Expression goes in area to the right labeled Diesel Expression.

 

 

Thank you a lot SLW210 and dbroada, to your answers!... It works as good as I need!!!...

Link to comment
Share on other sites

I was going to say that SLW210 helped me with this a little while back and I'll look for the thread but I don't need to as he has already posted the link.

 

Likewise. It is very hand and I use it in our template now.

Link to comment
Share on other sites

  • 3 years later...
Right Click in the Attribute Editor Value box and select Insert Field.

Field Category = Other > Field Names = Diesel Expression > Diesel Expression goes in area to the right labeled Diesel Expression.

 

Hi SLW210, Using this Diesel expession I have made a small alteration that works as good the first:

$(substr,$(getvar,"dwgname"),42,2)

 

**"xx" it's the length where the text will be cutted, and the number two (2) is how many letters do you need.

 

Thank you!...

Edited by CafeJr
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...