 - (defun GETPLVTX (E / ED)
- (defun DXF (NO)
- (cdr (assoc NO ED))
- )
- (defun GETLWPL (ED / PL BL)
- (while (setq ED (cdr (member (setq PL10 (assoc 10 ED)) ED)))
- (setq PL (cons (cdr PL10) PL))
- (setq BL (cons (cdr (assoc 42 ED)) BL))
- )
- (list (reverse PL) (reverse BL))
- )
- (defun GETPL (ED / E PL BL P10)
- (setq E (DXF -1))
- (while (setq E (entnext E))
- (if (setq P10 (cdr (assoc 10 (entget E))))
- (progn
- (setq PL (cons P10 PL))
- (setq BL (cons (cdr (assoc 42 (entget E))) BL))
- )
- )
- )
- (list (reverse PL) (reverse BL))
- )
- (setq ED (entget E))
- (setq PLTYPE (DXF 0))
- (cond
- ((= "POLYLINE" PLTYPE)
- (GETPL ED)
- )
- ((= "LWPOLYLINE" PLTYPE)
- (GETLWPL ED)
- )
- )
- )
- (defun c:test( / ent pts)
- (setq ent (car (entsel "选择界址线...")))
- (setq pts (GETPLVTX ent))
- (princ (strcat "\n界址点:" (apply 'strcat (mapcar '(lambda(e) (strcat (vl-princ-to-string e) " ")) (car pts)))))
- (princ (strcat "\n凸度:" (apply 'strcat (mapcar '(lambda(e) (strcat (vl-princ-to-string e) " ")) (cadr pts)))))
- (princ)
) |