Jump to content

Grabbing File Name


Kenter

Recommended Posts

Is there a way to grab the name of the file you are working on, and store it as a variable??

 

eg.

You open a file called 'square', and you want to take the drawing name and store it as variable 'name'.....

 

Not sure if this can be done, but if it is possible, the answer would be found on this forum for sure.

 

Kenter

Link to comment
Share on other sites

It can certainly be done. Type the following code into the command line.

 

 
(setq name (getvar "DWGNAME"))

 

Afterwhich type: !name on the command line.

Link to comment
Share on other sites

Thank you both. I used:

 

(setq name (substr (getvar 'dwgname) 1 (- (strlen (getvar 'dwgname)) 4)))

It grabbed it without taking the .dwg at the end.

 

 

Kenter

Link to comment
Share on other sites

Thank you both. I used:

It grabbed it without taking the .dwg at the end.

Kenter

 

Really a very smart result . :thumbsup: you do have the ability to get through codes.

 

Best regards

 

Tharwat

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...