Jump to content

Recommended Posts

Posted

Hi, i'm working to thousands of sheet drawings with inconsistent layout name on each sheet drawing, i want to make it standard or uniform, the idea is to rename the layout name as per the filename of the sheet drawing (i.e if the sheet drawing filename is A100.dwg the layout name should be A100 ). by the way all our sheet drawings contain one (1) layout only. Is there any lisp routine to batch rename say thousands or hundreds of sheet drawings without opening them one by one?

 

Your help is appreciated much.

 

thanks in advance.

the courage dog.

Posted

Dig up Lee's batch editor program and apply this function..

 

(defun NameToLayout (Doc)
 (vlax-for x (vla-get-layouts Doc)
   (vl-catch-all-apply 'vla-put-name (list x (vl-filename-base (getvar 'dwgname))))
 ) ;_ vlax-for
) ;_ defun

Posted
Batch program here:

 

http://www.theswamp.org/index.php?topic=31827.0

 

You'll need to add a vla-save / vla-saveas to Alan's code. Also, with the save included bear in mind that thumbnails will be lost until the next manual save.

LoL

That might help.

Lee, can you execute (layoutlist) during ODBX? If so, this might be a little faster.

 

(defun NameToLayout (Doc)
 (vl-catch-all-apply
   'vla-put-name
   (list (vla-item (vla-get-layouts Doc) (car (layoutlist)))
         (vl-filename-base (getvar 'dwgname))
   ) ;_ list
 ) ;_ vl-catch-all-apply
 (vla-save Doc)
) ;_ defun

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