在选择中按颜色选择
(defun c:SBC ( / c d e l )(if (setq e (car (entsel)))
(progn
(setq c
(cond
( (cdr (assoc 62 (entget e))) )
( (abs (cdr (assoc 62 (tblsearch "LAYER" (cdr (assoc 8 (entget e))))))) )
)
)
(while (setq d (tblnext "LAYER" (null d)))
(if (= c (abs (cdr (assoc 62 d))))
(setq l (cons "," (cons (cdr (assoc 2 d)) l)))
)
)
(sssetfirst nil
(ssget "_X"
(if l
(list
(cons -4 "<OR")
(cons 62 c)
(cons -4 "<AND")
(cons 62 256)
(cons 8 (apply 'strcat (cdr l)))
(cons -4 "AND>")
(cons -4 "OR>")
)
(list (cons 62 c))
)
)
)
)
)
(princ)
)
(prompt "\nDigite: SBC")
我非常感谢你的帮助,改变这一极好的习惯:我觉得我做不到。
我打算做同样的工作,但不是在全球的绘图,但只有一个具体的选择。例程必须首先允许获得所需的颜色,然后过滤选择。 看起来很熟悉
从ssget表达式中删除“_X”。
李,
美好的
又是坦克! 别担心 我发布的这个过滤选择例程可能很有趣:http://www.theswamp.org/index.php?topic=35028.msg402471#msg402471 不管怎样,我看到你也在层列表中进行匹配,而不仅仅是在对象级别。
alanjt,
阿滕顿的坦克!
页:
[1]