• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

rename multiple layouts simultaneously

  • Thread starter Thread starter riccardo.sistema
  • Start date Start date

riccardo.sistema

Guest
could someone kindly indicate me a quick way to rename all the windows of my layouts, without all the time going to edit it with the double clik on its window? ? ?
 
Last edited by a moderator:
definitely after reading the regulation :mixed:, presented in the appropriate section and avoiding to write in case... that on the web is equivalent to shouting:
 
I apologize for ignorance but I didn't want to shout absolutely to anyone...it's the first time I join a forum so I hope you didn't get offended and for fairness I give you the question correctly quoted:

Could someone kindly indicate me a quick way to rename all the windows of my lay out, without having to change it with double clik on its window? ? ?
 
presentation carried out
I give you an example:
in an autocad file I have about 240 lay out numbered in progressive order and I have the need to rename these lay out for example if in a file go from 1 to 240 in the other they will have to be appointed from 241 to 480;
the question simply consists in knowing if there is a faster way to rename these lay out without all the time going into its window making double clik to change the name.
I hope I've been clearer
Thank you.
 
proof questo:
(vl-load-com)
(setq n 100)
(setq lays (vla-get-layouts (vla-get-activedocument)))
(vlax-for x lays
(if (not (eq (strcase (vla-get-name x)) "model"))
(vla-put-name x (itoa n))
)
(setq n (1+ n))
)
 
I apologize for my ignorance but I don't have any basics about programming so you could kindly tell me where to go to insert these lines
thank you very much for the interest

proof questo:
(vl-load-com)
(setq n 100)
(setq lays (vla-get-layouts (vla-get-activedocument)))
(vlax-for x lays
(if (not (eq (strcase (vla-get-name x)) "model"))
(vla-put-name x (itoa n))
)
(setq n (1+ n))
)
 
the attached file you must place it in one of the specified routes in autocad with the option command -> search path of the support files.
after run (load "numlayout")
type numlayout. now has become a new autocad command.
 

Attachments

and if my layouts have a numbering type 1_1;1_2;1_3 ... 2_1;2_2;2_3 ... 3_1;3_2;3_3 etc... What should I change within this very useful lisp?
thank you very much for the interest

the attached file you must place it in one of the specified routes in autocad with the option command -> search path of the support files.
after run (load "numlayout")
type numlayout. now has become a new autocad command.
 
instead of
(vla-put-name x (Time n))
Put it on
(vla-put-name x (tight "1 _" (toa n)))

or 2_, 3_ecc

thanks also to confutatis that has me finished the code, taking for granted what is not always true.
 
I wanted to integrate the previous post, but the 15 minutes of waiting were taken, so I'll open another one.
this may also not affect richer, but part of the previous code (from vlax-for....) can be replaced with another equivalent, perhaps faster.

(vlax-map-collection lays '(lambda (x)
(if (not (eq (strcase (vla-get-name x))) "model")
(vla-put-name x (strcat "2_" (itoa n)))
)
(setq n (1+ n))
)
)

Hello, everyone.
 
I'm sorry, but I can't handle it.
Maybe I try to spice it out more exhaustively:
then inside my worksheet I have 240 lay out numbered as follows:
1_1; 1_2; 1_3; up to 1_20; 2_1; 2_2; 2_3; up to 2_20; 3_1;3_2;3_3; up to 3_20;
up to 11_1; 11_2; 11_3; up to 11_20 which is the last.
now I would like to make them start from the first lay out:
12_1; 12_2; 12_3; up to 12_20; 13_1; 13_2; 13_3; up to 13_20; up to 23_1; 23_2; 23_3; up to 23_20 which will be the last.
I can't change your lisp in order to get this result. . .
I still apologize for ignorance in the matter and especially for trouble
Thanks again
 
we are almost there is only one problem does not put them in order as before i.e. rename them correctly but change the positions of my lay out:
a solution could be to keep a part of the name constant and change only the first i.e.:
If my lay out is called 1_1 , I will have to change only the first n. i.e. 1 while '_1' will have to be constant so far up to 1_20 , the constant '_20'.
only that this solution I can't translate it into programming language, even if I'm starting to read the manual for the autolisp
I hope to have been clear and yet thank you endlessly for the interest
 
really from yesterday's post at 16.11 seemed to me that you asked otherwise: keep the first number fixed and change the second from 1 to 20.
theoretically the .lsp file should only rename them without changing their location: I'm missing something.
 
education (setq n2 (1+ n2)) should be inserted within the condition if we are on model space or paper space, in fact I missed a number when it found the model space.

in reality the layouts are not moved, but renamed according to their alphabetical order, although created later, with the risk of creating a real soup. . .
 

Attachments

Good morning
I'm luca, new member of the group.
I accus to the previous request to know if it is possible to replace a part of the name of both the layout and the layers automatically, without rename one by one;
In particular, I would like to change for example: "luca_1_chiaro_1" in "luca_1_scuro_1" for all print layouts and for all layers...in practice change only the word "key" with "scuro"
Is that possible?
Thank you.
 
Good day, I was trying to use this lisp to automatically rename the layouts, and I came across a problem.
an architect sends me a list elaborated so composed
bie-pe-tav-im.001, bie-pe-tav-im.002, bie-pe-tav-im.003,
If for the name I had no problem inserting it for the number instead I do not find the solution.
I've always been wrong.
Do you have any advice?
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top