- 积分
- 1638
- 明经币
- 个
- 注册时间
- 2013-6-20
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
5明经币
本帖最后由 yangist 于 2013-7-3 08:42 编辑
(setq ss (ssget '((0 . "arc,circle,ellipse,line,*polyline")))) ;最好只选择下面四种线型
(setq ss1(ssget ss ( ;选取center线型和Bylayer为center的线型,包含块
(setq ss2(ssget ss ( ;选取dashed线型和Bylayer为dashed的线型,包含块
(setq ss3(ssget ss ( ;选取phantom线型和Bylayer为phantom的线型,包含块
(setq ss3(ssget ss ( ;选取divide线型和Bylayer为divide的线型,包含块
谢谢!
下面附上按颜色选对象的程序,供您参考
(defun hy_leachcolorlist(en / eno color layer ccolor cord_laye layerlist
layerlist1 layername layercolor needlis);;;;参照物体颜色
(SETQ needlis NIL)
(if (= (type en) 'ENAME)
(progn
(setq eno (vlax-ename->vla-object en))
(setq color (vla-get-color eno))
(setq layer (vla-get-layer eno))
(setq ccolor (cdr(assoc 62 (entget(tblobjname "layer" layer)))))
(setq cord_layer (tblnext "layer" t))
(setq layerlist nil layerlist1 nil)
(while cord_layer
(setq layername (cdr(assoc 2 cord_layer)))
(setq layercolor (cdr(assoc 62 cord_layer)))
(if (= layercolor color)(setq layerlist (cons (cons 8 layername) layerlist)))
(if (= layercolor ccolor)(setq layerlist1 (cons (cons 8 layername) layerlist1)))
(setq cord_layer (tblnext "layer"))
)
(if (/= color 256)
(setq needlis (append '((-4 . "<or"))
(list(cons 62 color))
'((-4 . "<and")(62 . 256)(-4 . "<or"))
(append layerlist (list(cons 62 color)) )
'((-4 . "or>")(-4 . "and>")(-4 . "or>"))))
(setq needlis (append '((-4 . "<or"))
(list '(-4 . "<and")(cons 8 layer)'(62 . 256)'(-4 . "and>"))
(list(cons 62 ccolor))
'((-4 . "<and")(62 . 256)(-4 . "<or"))
layerlist1
'((-4 . "or>")(-4 . "and>")(-4 . "or>"))
))
)
))
(if (= (type en) 'INT) (progn
(setq color EN)
(setq cord_layer (tblnext "layer" t))
(setq layerlist nil)
(while cord_layer
(setq layername (cdr(assoc 2 cord_layer)))
(setq layercolor (cdr(assoc 62 cord_layer)))
(if (= layercolor color)(setq layerlist (cons (cons 8 layername) layerlist)))
(setq cord_layer (tblnext "layer"))
)
(if (/= color 256)
(setq needlis (append '((-4 . "<or"))
(list(cons 62 color))
'((-4 . "<and")(62 . 256)(-4 . "<or"))
(append layerlist (list(cons 62 color)) )
'((-4 . "or>")(-4 . "and>")(-4 . "or>"))))
)
))
needlis
) |
|
|