最近点连线
有没有最近点连线的LISP啊,(defun c:tt ()
(setq ss (ssget (list (cons 0 "point"))))
(setq lst (xyp-Sort-Plist (xyp-Sort ss 10 "Y-max") 1))
(setq ptn (mapcar 'car lst))
(setq pt (getpoint "指定起点"))
(setq nn (sslength ss))
(command "pline")
(repeat nn
(setq
ptn (vl-sort ptn
'(lambda (a b)
(> (distance a pt) (distance b pt))
)
)
)
(setq pt1 (last ptn))
(commandpt pt1 )
(setq pt (last ptn))
(setq ptn (cdr (reverse ptn)))
)
(command"")
)
这个院长写得不错,就是缺东少西的,哈哈
论坛搜搜还是有的 找到一个,稍微修改一下还能用{:1_1:}
页:
[1]