x_s_s_1 发表于 2011-4-19 22:49:21

这个问题没看懂,什么叫复制到图层1上啊,看看这个安用不
(defun c:cp ()
(princ "\n选择需拷贝物体:")
(setq ss (ssget))
(initget 1 "Bynow Input Choose")
(setq CTRL (getkword "方式[当前(B)/输入(I)/选择(C)]: "))
(if (= ctrl "Input")
    (setq lay (getstring "输入图层名:"))
    (if        (= ctrl "Bynow")
      (setq LAY (getvar "CLAYER"))
      (setq
        LAY (cdr (assoc 8 (entget (car (entsel "选所需图层物体:")))))
      )
    )
)
(command "copy" ss "" "0,0" "0,0")
(COMMAND "CHPROP" "P"        "" "LA"        lay "LT" "bylayer" "C" "bylayer" "")
(command "move" "p" "")
)

slzlfs 发表于 2011-4-20 07:49:09

express 插件里有图层

198526 发表于 2011-4-23 11:57:07

那你可以在LISP里先写一段复制再写改图层啊

lisp爱好者 发表于 2011-4-23 13:39:30

198526 发表于 2011-4-23 11:57 static/image/common/back.gif
那你可以在LISP里先写一段复制再写改图层啊

思路对的,这样比较直接
也可以先设置要复制到**图层,再复制图元

fangseng 发表于 2021-8-20 18:36:54

请试一下这个
(defun c:Acv ()
(SETQ BL123 (getvar "OSMODE"))
(command "ucs" "w" )
(COMMAND "OSMODE" 16384 )
(print "提示;先选要复制的图元,再选图层标签" )
(setq ww (ssget))
(SETQ jo (sslength ww))
获取图元所在的图层名的文本
(setq gg (ssget '((0 . "Text,Mtext,LINE,CIRCLE,"))))
(setq no (sslength gg))
(setq k 0)
(while (<= k (- no 1))
(setq tu (ssname gg k))
(setq wo (cdr (assoc 8 (entget tu))))
(setq n 0)
(while (<= n (- jo 1))
(setq wood (ssname ww n))
(command "copy" wood "" '(0 0) '(0 0))
(setq woodk (entlast))
(command "change" woodk "" "p" "LA" wo "")
(setq n (+ 1 n))
)
(setq k (+ 1 k))
)
(command "ucs" "W")
(command "osmode" 53)
(command "erase" ww "")
(setq p1 nil p2 nil tu nil oc nil sel nil)
)
页: 1 [2]
查看完整版本: AutoCAD中能把一个图层上的对象复制到另一个图层上吗?