惜惜2 发表于 2024-9-2 11:32:32

把所有图层放入到0层

本帖最后由 惜惜2 于 2024-9-5 08:05 编辑

(DEFUN C:ASA ()
(command ".explode" ss "")
(if (= (getvar "cmdactive") 1) (ssget "x" ) (sssetfirst nil (ssget "x" )))
(princ)
)


我需要把块炸开以后全选放入0层,颜色以及线型线宽随层,全选以后提示未知命令这个需要怎么改

惜惜2 发表于 2024-9-3 08:19:17

qazxswk 发表于 2024-9-2 18:22


感谢大佬:handshake

qazxswk 发表于 2024-9-2 18:22:58

(defun C:A11()
(vl-cmdf "qaflags" 1 "explode" (ssget "x") "" "qaflags" 0)
(if (= (getvar "cmdactive") 0)
(progn
(vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
(vl-cmdf "change" (ssget "x") "" "p" "c" "ByLayer" "")
(vl-cmdf "change" (ssget "x") "" "p" "LT" "ByLayer" "")
)
)
(princ)
)

惜惜2 发表于 2024-9-2 17:10:30

qazxswk 发表于 2024-9-2 16:31
(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)


我改成这个可以自动选了 ,颜色和线型随0层怎么改?
(defun C:A11 ()
(if (= (getvar "cmdactive") 1) (ssget "x" ) (sssetfirst nil (ssget "x" )))
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)
(if (= (getvar "cmdactive") 0)
(vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
)
(princ)
)

惜惜2 发表于 2024-9-2 17:01:33

qazxswk 发表于 2024-9-2 16:31
(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)


不对啊颜色和线宽不能随0层    还有我看我的代码是可以自动全选的你这个需要手动框选对象

qazxswk 发表于 2024-9-2 16:31:38

(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)
(if (= (getvar "cmdactive") 0)
(vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
)
(princ)
)

sniper1111 发表于 2024-9-2 13:43:14

直接合并图层多好。

dxy796 发表于 2024-9-2 12:24:44

人为添堵:@
页: [1]
查看完整版本: 把所有图层放入到0层