- (defun c:tt (/ LA P0 PT S PL A)
- (setq la (getvar 'clayer))
- (setq p0 (getpoint "\n第一点:"))
- (while (setq pt (getpoint p0 "\n下一点:"))
- (setq s (ssget "f" (list p0 pt) (list (cons 0 "line") (cons 8 la))))
- (if s
-
- (progn
- (setq pl (mapcar '(lambda (x) (cadr (cadddr x))) (ssnamex s)))
- (setq a p0)
- (foreach b pl
- (entmake
- (list '(0 . "line")
- (cons 10 a)
- (cons 11 b)
- )
- )
- (setq a b)
- )
- (entmake
- (list '(0 . "line")
- (cons 10 a)
- (cons 11 pt)
- )
- )
- )
- (entmake
- (list '(0 . "line")
- (cons 10 p0)
- (cons 11 pt)
- )
- )
- )
- (setq p0 pt)
- )
- (princ)
- )
|