只选择纵线[code="lisp]
(vl-load-com)
(defun c:tt (/ ss lst lst1 m n x y f)
(defun x_ssn (ss / n lst)
(repeat (setq N (sslength ss))
(setq LST (cons (ssname SS (setq N (1- N))) LST))
)
)
(defun deldup (ptLst alw / pt1)
(cond ((<= (length ptLst) 1) ptLst)
(t
(setq pt1 (car ptLst))
(cons pt1
(vl-remove-if
'(lambda (x) (equal pt1 x alw))
(deldup (cdr ptLst) alw)
)
)
)
)
)
(defun get_dxf (en num /) (cdr (assoc num (entget en))))
(setq f (open (getfiled "坐标输出为:" "d:/" "txt" 1) "w"))
(prompt "\n仅选择纵向线:")
(setq ss (ssget)
lst (x_ssn ss)
lst (vl-sort
lst
'(lambda (x y) (< (car (get_dxf x 10)) (car (get_dxf y 10))))