The Courage Dog Posted March 16, 2010 Posted March 16, 2010 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. Quote
alanjt Posted March 16, 2010 Posted March 16, 2010 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 Quote
Lee Mac Posted March 16, 2010 Posted March 16, 2010 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. Quote
alanjt Posted March 16, 2010 Posted March 16, 2010 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 Quote
Recommended Posts
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.