-
- ;;BY龙龙仔(LUCAS)
- ;;这样会快一点
- (defun C:GETPT_LAI (/ SS N P1 P2 PT_LIST PT_LIST1 LEN)
- (setq SS (ssget '((0 . "*POLYLINE"))))
- (if SS
- (progn
- (setq N 0
- LEN (sslength SS)
- )
- (repeat LEN
- (setq PT_LIST (append PT_LIST (GETLISTOFPLINE (ssname SS N))))
- (setq N (1+ N))
- )
- (setq
- PT_LIST
- (vl-sort PT_LIST
- (function (lambda (P1 P2)
- (cond ((< (car P1) (car P2)) t)
- ((and (= (car P1) (car P2))
- (< (cadr P1) (cadr P2))
- )
- t
- )
- (t NIL)
- )
- )
- )
- )
- )
- (setq N 0
- LEN (- (length PT_LIST) 1)
- )
- (repeat LEN
- (if (and (equal (nth N PT_LIST) (nth (1+ N) PT_LIST))
- (not (member (nth N PT_LIST) PT_LIST1))
- )
- (setq PT_LIST1 (append PT_LIST1 (list (nth N PT_LIST))))
- )
- (setq N (1+ N))
- )
- PT_LIST1
- )
- )
- )
|