如何:根据单选对象的颜色线型,框选出相同属性的对象
如何:根据单选对象的颜色线型,框选出相同属性的对象只有一个币了
fengyu6913 发表于 2024-8-11 12:18
如果结合线型就好了
(defun c:tt (/ a b en len s0 ss ss1 xxys x ys yslst)
(defun xxys (en)
(setq xx (vla-get-linetype (vlax-ename->vla-object en)))
(setq ys (vla-get-Color (vlax-ename->vla-object en)))
)
(setq yslst nil ss1 (ssadd))
(while (setq s0 (car (entsel "\n请选过滤颜色对象: ")))
(redraw s0 3)
(xxys s0)
(setq yslst (cons(list xx ys) yslst))
)
(setq ss (ssget))
(repeat (setq len (sslength ss))
(setq s0 (ssname ss (setq len (1- len))))
(xxys s0)
(foreach x yslst
(setq a (nth 0 x) b (nth 1 x))
(if(and(= a xx)(= b ys))(ssadd s0 ss1))
)
)
(sssetfirst nil ss1)
(princ (strcat "\n已选择" (itoa (sslength ss1)) "个对象"))
(princ)
)
;;选非随层颜色对象
(defun c:11 (/ss ent ss1)
(setq ss (ssget ":s") ent (entget (ssname ss 0)) )
(princ "\n已获取色值,框选同色值对象,回车全选同色值对象:")
(setq ss1 (ssget ":s" (list(assoc 62 ent))))
(if ss1 (sssetfirst nil ss1) (ssget "X" (list(assoc 62 ent))) )
(princ)
) 如果结合线型就好了 感谢各位大佬帮忙解决同时又分享源码, 不错,感谢分享,可以用快速选择类的工具也可以解决
页:
[1]