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

cambiare il layer

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I would like to realize a command that changes the plan to all "circle" elements of a design.
if possible I would like the command to affect the circles that are part of a certain layer"
my current knowledge of the lisp recommend the help of a kind willing!
Thank you.
 
Code:
(defun c:chgcirclelayer(/ sel layerdest layer)
    (setq layerdest (getstring "\nlayer di destinazione: "))
    (setq layer (getstring "\nlayer: "))
    (if (= layer "")
        (setq layer "*")
    )
    (command "_layer" "_m" layerdest "")   
    (setq sel (ssget "x" (list (cons 0 "circle") (cons 8 layer))))
    (if (/= sel nil)
        (command "_change" sel "" "_pr" "_la" layerdest "")
    )   
)
Target layer: if there is no importance, the routine creates it regardless.
layer: you can also indicate multiple layers at the same time, just separate them from the comma; e.g.: walls, walls
 
thanks rpor66, perfect as always!
if instead of the plan, you want to change the size or the diameter?
Thank you.
 
Code:
(defun c:chgdiamcircle(/ sel c n)
(setq diam (getreal "\ndiametro:")
(setq sel (ssget "x" (list (cons 0 "circle"))))
(if (/= sel nil)
(progn)
(setq c 0)
(repeat (sslength sel)
(sssname sel c)
(vlax-put-property (vlax-ename->vla-object n) 'radius (/diam 2.0))
(setq c (1+ c))
)
)
)
)
 

Forum statistics

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

Members online

No members online now.
ciao
Back
Top