hello
i need a lisp that copy selected objects to current layer.
e.g
commande: copy
Select objects: .... found
Specify base point or [Displacement/mOde/Layer] <Displacement>:L
Enter layer option for copie objects [Current/Source] <Source>:
thanks
(defun c:cpl (/ ss)
(princ"\nSelect Objects To Copy")
(setq ss(ssget))
(if ss
(progn
(command"_.Copy" ss "" "0,0,0" "0,0,0")
(command"_.ChProp" ss "" "_LA" (getvar"clayer") "")
)
(princ"\nNo Objects Selected")
)
I've found that I like the COPYTOLAYER command better than COPY. Give this a try.
(defun c:c2c (/ curlay ss1 ) (setq curlay (getvar "clayer")) (while (null ss1) (setq ss1 (ssget)) ) (command "COPYTOLAYER" ss1 "" curlay "") )
Hi majdov24,
I would suggest the use of 'Copy' with the 'Layer' option, or 'Copy' and 'Chprop', or the "Copytolayer" command , or....,
but, we should test for a valid selection set, before proceeding with the copy* command...
(defun c:c2cl (/ ss) (if (setq ss (ssget "_:L"));to Exclude Locked Layers (command "_.copytolayer" ss "" (getvar 'clayer) "") (princ "0 found") ) (princ) )
Hope this helps,
Henrique