- (defun c:tet ()
- (defun juxingguolv (ss / ent i j lst1 lst2 maxpoint minpoint nam name1 name2 pmax pmin pt1x pt1y pt2x pt2y pt3x pt3y pt4x pt4y ) ; 过滤掉矩形选择集内的矩形子函数 nam
- (setq lst1 '())
- (repeat (setq i (sslength ss))
- (setq nam (ssname ss (setq i (1- i))))
- (vla-getboundingbox (vlax-ename->vla-object nam) 'minpoint 'maxpoint)
- (setq pmax (vlax-safearray->list maxpoint) pmin (vlax-safearray->list minpoint))
- (setq lst1 (cons (list pmin pmax nam) lst1))
- )
- (setq lst2 lst1)
- (repeat (setq i (length lst1))
- (setq nam (nth (setq i (1- i)) lst1))
- (setq pt1x (car (car nam)) pt1y (cadr (car nam)) pt2x (car (cadr nam))
- pt2y (cadr (cadr nam)) name1 (caddr nam) )
- (repeat (setq j (length lst2))
- (setq ent (nth (setq j (1- j)) lst2 ))
- (setq pt3x (car (car ent)) pt3y (cadr (car ent)) pt4x (car (cadr ent))
- pt4y (cadr (cadr ent)) name2 (caddr ent))
- (if (and (> pt3x pt1x) (> pt3y pt1y) (< pt4x pt2x) (< pt4y pt2y))
- (if (ssmemb name2 ss) (setq ss (ssdel name2 ss))))
- (if (and (< pt3x pt1x) (< pt3y pt1y) (> pt4x pt2x)(> pt4y pt2y))
- (if (ssmemb name1 ss) (setq ss (ssdel name1 ss))))))
- ss
- )
- (setvar "cmdecho" 0) ;指令执行过程不响应
- (setq ss (ssget (list'(0 . "LWPOLYLINE,CIRCLE"))))
- (progn
- (setq ss (juxingguolv ss))
- (sssetfirst nil ss)
- (command "_.chprop" SS "" "c" "1" "")
-
- ))
|