bono05 Posted April 7, 2016 Posted April 7, 2016 Hi, It's possible to find this? I need to rename a lot layout's name from a dwg (for sample): Floor 00.1 ----> Floor 01.1 Floor 00.2 ----> Floor 01.2 Floor 00.3 ----> Floor 01.3 thanks!! Quote
Tharwat Posted April 7, 2016 Posted April 7, 2016 Hi, Are you talking about specific layout names as in your example or ALL layouts to deduct the zero which is on the left side hand ? Show an example. Quote
bono05 Posted April 7, 2016 Author Posted April 7, 2016 As you can see here, i need to replace: APP A1.xx to APP A2.xx (for 2nd floor) APP A1.xx to APP A3.xx (for 3th floor) ... Quote
Tharwat Posted April 7, 2016 Posted April 7, 2016 There must be a criteria to follow for renaming layouts, so what is the principle in your case? Quote
bono05 Posted April 7, 2016 Author Posted April 7, 2016 (edited) Weel i find this on the net...it's look like working like a find replace only for layouts! What do you think about this? (defun c:FRlayout (/ #Find #Replace) (vl-load-com) (and (setq #Find (getstring T "\nFind what: ")) (setq #Replace (getstring T "\nReplace with: ")) (not (vl-position "" (list #Find #Replace))) (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (vl-catch-all-apply 'vla-put-name (list x (vl-string-subst #Replace #Find (vla-get-name x)))) ) ;_ vlax-for ) ;_ and (princ) ) ;_ defun Edited April 8, 2016 by SLW210 Changed Quote Tags to Code Tags! Quote
BIGAL Posted April 8, 2016 Posted April 8, 2016 You need also something like lee-macs parse numbers when you get the layout name use parse numbers to return the 1.02 and check if its with in the range of layouts you want to change start ="App 1.03" end ="App 1.11" gives 1.031.11 etc then only change the correct layouts. The code you have is nearly there. Quote
asos2000 Posted April 12, 2016 Posted April 12, 2016 Give this a try http://www.lee-mac.com/tabsort.html 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.