- ;;;lst 点表ucs
- ;;; oi闭合否
- (defun tt (lst oi)
- (if oi
- (setq lst (reverse (cons (car lst) (reverse lst)))))
- (mapcar
- '(lambda (x y)
- (entmakex (list (cons 0 "line")
- (cons 10 (trans x 1 0))
- (cons 11 (trans y 1 0)))))
- lst
- (cdr lst)))
- ;;;test
- (defun c:test (/ lst1 lst2 pt1)
- (setvar "pdmode" 35)
- (setq pt1 (getpoint "\nget point:"))
- (setq lst1 (list (entmakex (list (cons 0 "point")
- (cons 10 (trans pt1 1 0)))))
- lst2 (cons pt1 lst2))
- (while (setq pt1 (getpoint pt1 "\nget next point:"))
- (setq lst1
- (cons
- (entmakex (list (cons 0 "point")
- (cons 10 (trans pt1 1 0))))
- lst1)
- lst2 (cons pt1 lst2)))
- (tt (reverse lst2) nil)
- (foreach n lst1 (entdel n))
- (setvar "pdmode" 0))
|