这是我用的,不知为和删除不了(90 . 3)重圆?- ;删重圆环 明经 ZXQ 2013.8.14 截面钢筋统计
- (setvar "CMDECHO" 0)(princ " \n 删重圆环 截面钢筋统计")
- (setq ss (ssget '((0 . "LWPOLYLINE")(-4 . "<or")(90 . 2)(90 . 3)(-4 . "or>")
- (-4 . "<or")(42 . 1)(42 . -1)(-4 . "or>"))))
- (setq n (sslength ss))
- (setq i -1)
- (setq en (ssname ss (setq i (1+ i))))
- (vla-getboundingbox (vlax-ename->vla-object en) 'minpoint 'maxpoint)
- (setq pmax (vlax-safearray->list maxpoint) pmin (vlax-safearray->list minpoint))
- (setq ss1 (ssget "C" pmin pmax '((0 . "LWPOLYLINE")(-4 . "<or")(90 . 2)(90 . 3)(-4 . "or>")
- (-4 . "<or")(42 . 1)(42 . -1)(-4 . "or>"))))
- (if (> (sslength ss1) 1)
- (progn
- (setq ss1 (ssdel en ss1))
- (setq j -1)
- (repeat (sslength ss1)
- (setq en1 (ssname ss1 (setq j (1+ j))))
- (ssdel en1 ss)
- (entdel en1)
- (setq n (sslength ss))
- )
- )
- )
- ;(setq ss (sslength (ssget '((0 . "*polyline") (70 . 1) (90 . 2)))))
- (setq str (strcat "======截面钢筋根数为:( " (itoa n) " )======"))
- (princ str)
- )
|