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

modify part of the nome layout e layer

lucaroma90

Guest
Good morning
I'm luca, new member of the group.
I tried to search in the forum but at the discussion (https://www.cad3d.it/forum1/threads...emporaneamente-più-layout?p=411384#post411384) I did not find the solution.
I ask if you can 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.
 
Thanks for the answer.
for the layouts I managed and everything works perfectly...for the layers I would like to replace only one part of the name without rename them completely all. How can I do this?
 
in the forum there is an excel file that creates scripts. this allows you to exploit the functions of excel and then work on parts of the cell value and be able to transform the luca-clear value into luca-scuro
 
Given that I am not a script expert, is there no other way to rename only one word for all layers, leaving the rest of the name unaltered?
 
proof questo lisp di henrique brunette da silva
Code:
(vl-load-com)
(defun c:ren_lay (/ new old)
  (if (and (setq old (getstring t "\nenter old layer name (is case sensitive): "))
	   (/= old "")
           (setq new (getstring t "\nenter new layer name (is case sensitive): "))
           (/= new "")
      )
    (vlax-for layer
		    (vla-get-layers
		      (vla-get-activedocument
			(vlax-get-acad-object)
		      )
		    )
      (if (wcmatch (vla-get-name layer) (strcat "*" old "*"))
	(vl-catch-all-apply
	  'vla-put-name
	  (list layer (vl-string-subst new old (vla-get-name layer)))
	)
      )
    )
  )
  (princ)
)
 

Forum statistics

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

Members online

No members online now.

Back
Top