求大佬帮忙修正一下红色处的代码
(defun C:A11 ()(vl-cmdf "qaflags" 1 "explode" (ssget "x") "" "qaflags" 0)
(setq bendlayer (tblsearch "layer" "BEND"))
(if (null bendlayer)
(progn
(command "layer" "m" "BEND" "c" "2" "" "")
)
)
; 用户选择一个图元
(setq selectedent (car (entsel "\选择一个图元: ")))
; 获取选中图元的线型
(setq linetype (cdr (assoc 6 (entget selectedent))))
; 选择所有相同线型的图元
(setq ss (ssget "x" (list (cons 6 linetype))))
; 将相同线型的图元放入 BEND 层
(command "change" ss "" "p" "la" "BEND" "")
(command "change" ss "" "p" "C" "ByLayer" "")
(command "change" ss "" "p" "lT" "ByLayer" "")
; 获取不在BEND层的所有图元
(setq ss (ssget "x"))(这个代码是选中了所有的图元,需求获取不在BEND层的所有图元)
; 将不在BEND层的所有图元图元放入 0 层,颜色随层线宽随层
(command "change" ss "" "p" "la" "0" "")
(command "change" ss "" "p" "C" "ByLayer" "")
(command "change" ss "" "p" "lT" "ByLayer" "")
(command"_copyclip"(ssget "x" '((8 . "0"))))
(command"")
(princ)
)
(setq ss (ssget "x" '((8 . "~BEND")))) 飞雪神光 发表于 2024-9-9 16:46
谢谢:handshake 这部分请参看
wcmatch 函数帮助
Performs a wild-card pattern match on a string
(wcmatch string pattern)
页:
[1]