pmadhwal7 Posted July 3, 2020 Share Posted July 3, 2020 Today i noticed that autocad have only 255 layout limit, and now problem is renaming the tabs i have to make 100 more layouts and if i rename it manually it will take time so i want to ask is their any fat way to rename layouts after 255 sheet's like 256,257,258 etc from 1 to 255 sheets I changed from Lisp , but if I run this lisp in on other sheets, then they will rename them 1-255 again. Quote Link to comment Share on other sites More sharing options...
dlanorh Posted July 3, 2020 Share Posted July 3, 2020 5 hours ago, pmadhwal7 said: Today i noticed that autocad have only 255 layout limit, and now problem is renaming the tabs i have to make 100 more layouts and if i rename it manually it will take time so i want to ask is their any fat way to rename layouts after 255 sheet's like 256,257,258 etc from 1 to 255 sheets I changed from Lisp , but if I run this lisp in on other sheets, then they will rename them 1-255 again. Is this a *.lsp lisp or a *fas or *vlx. If the former then there must be a counter somewhere in the lisp that enables it to start at one. Change the initial value to whatever you want, or attach it. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 3, 2020 Share Posted July 3, 2020 If you look at this (setq num (vla-get-count (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))) it will tell you how many layouts, note you need to subtract 1 as "Model" is included. Quote Link to comment Share on other sites More sharing options...
pBe Posted July 4, 2020 Share Posted July 4, 2020 6 hours ago, BIGAL said: If you look at this (setq num (vla-get-count (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))) it will tell you how many layouts, note you need to subtract 1 as "Model" is included. or simply (setq num (length (layoutlist))) Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted July 4, 2020 Author Share Posted July 4, 2020 18 hours ago, dlanorh said: Is this a *.lsp lisp or a *fas or *vlx. If the former then there must be a counter somewhere in the lisp that enables it to start at one. Change the initial value to whatever you want, or attach it. here it is... Rename layouts.lsp Quote Link to comment Share on other sites More sharing options...
pBe Posted July 4, 2020 Share Posted July 4, 2020 (defun c:ren (/ n a i l p x) (if (setq n (getint "\nEnter Start number: ")) (progn (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (setq l (cons x l))) (setq l (cdr (vl-sort l '(lambda (a b) (< (vla-get-taborder a) (vla-get-taborder b)))))) (setq i 0) (foreach x l (setq i (1+ i)) (vla-put-name x (strcat "FooTempBazoom_" (itoa i)))) (setq a (strlen (itoa (length l)))) (foreach x l (setq p "") (repeat (- a (strlen (itoa i))) (setq p (strcat p "0"))) (vla-put-name x (strcat p (itoa n))) (setq n (1+ n)) ) ) ) (princ) ) (vl-load-com) "FooTempBazoom_" <--- This is hilarious Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted July 4, 2020 Author Share Posted July 4, 2020 1 hour ago, pBe said: (defun c:ren (/ n a i l p x) (if (setq n (getint "\nEnter Start number: ")) (progn (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (setq l (cons x l))) (setq l (cdr (vl-sort l '(lambda (a b) (< (vla-get-taborder a) (vla-get-taborder b)))))) (setq i 0) (foreach x l (setq i (1+ i)) (vla-put-name x (strcat "FooTempBazoom_" (itoa i)))) (setq a (strlen (itoa (length l)))) (foreach x l (setq p "") (repeat (- a (strlen (itoa i))) (setq p (strcat p "0"))) (vla-put-name x (strcat p (itoa n))) (setq n (1+ n)) ) ) ) (princ) ) (vl-load-com) "FooTempBazoom_" <--- This is hilarious Great working fine many thanks................................. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 5, 2020 Share Posted July 5, 2020 You may also wish to consider this existing program. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 6, 2020 Share Posted July 6, 2020 You may want the D01-D09 as layout names as well. ; if less than 10 (if (< (car dwgnum) 10.0) (setq newstr2 (strcat dwgname "-D0" (rtos sheetnum 2 0))) (setq newstr2 (strcat dwgname "-D" (rtos sheetnum 2 0))) ) Quote Link to comment Share on other sites More sharing options...
pmadhwal7 Posted July 6, 2020 Author Share Posted July 6, 2020 Thanks to both of you but problem is solve now.... Quote Link to comment Share on other sites More sharing options...
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.