按点顺序直接连起来了,剩下的事情,你自己做做吧
-
- (vl-load-com)
- (defun c:test( / ent ptLst i n dist l lMax)
- (setq ent (car (entsel)))
- (repeat 6
- (setq ptLst (append ptLst (list (getpoint "\nPick a point:"))))
- )
- (setq ptLst (mapcar '(lambda(x) (list (vlax-curve-getDistAtPoint ent x) x)) ptLst))
- (setq ptLst (vl-sort ptLst '(lambda (x1 x2) ( lMax l)
- (progn
- (setq n (vl-position lMax dist))
- (repeat (1+ n)
- (setq ptLst (reverse (cons (car ptLst) (reverse (cdr ptLst)))))
- )
- )
- )
- (command "_.pline")
- (mapcar 'command (mapcar 'cadr ptLst))
- (command "")
- )
|