- (defun c:bhh ()
- ;(CMDLA0)
- (setq fz (ssget '((0 . "*LINE"))))
- (command "convertpoly" "H" fz "") ;转换成POLYLINE
- (setq n (sslength fz)
- i -1
- n1 0
- n2 0
- n3 0
- n4 0 ;本身闭合
- )
- (while (setq aa (ssname fz (setq i (1+ i))))
- (setq bb (entget aa)
- xx (dxf 0 bb)
- )
- (if (and (= xx "POLYLINE")
- (= (dxf 70 bb) 0)
- )
- (progn
- (setq spt (vlax-curve-getstartpoint aa)
- ept (vlax-curve-getendpoint aa)
- )
- (if (equal spt ept)
- (progn
- (command "pedit" "m" aa "" "c" "")
- (command "change" aa "" "p" "c" "2" "")
- (setq n1 (1+ n1))
- )
- (progn
- (command "change" aa "" "p" "c" "4" "")
- (setq n2 (1+ n2))
- )
- )
- )
- )
- (if (and (= xx "POLYLINE")
- (= (dxf 70 bb) 1)
- )
- (progn
- (command "change" aa "" "p" "c" "2" "")
- (setq n4 (1+ n4))
- ) )
- (if (= xx "LINE")
- (progn
- (command "change" aa "" "p" "c" "5" "")
- (setq n3 (+ n3 1))
- )
- )
- )
- (alert (strcat "\n原有闭合房子"
- (itoa n4)
- "个;本次闭合房子"
- (itoa n1)
- "个;发现不闭合房子"
- (itoa n2)
- "个;发现LINE线"
- (itoa n3)
- "条。"
- )
- )
- ;(CMDLA1)
- (princ)
- )
- (defun dxf (code elist) (cdr (assoc code elist)))
|