- (defun c:tt (/ pt)
- (setq p0 (getpoint "\n插入点: ") )
- (setq p1 (mapcar '+ p0 '(0 10 0) ) )
- (setq p2 (mapcar '+ p0 '(5 20 0) ) )
- (setq p3 (mapcar '+ p0 '(40 40 0) ) )
- (setq p4 (mapcar '+ p0 '(80 80 0) ) )
- (setq p5 (mapcar '+ p0 '(150 90 0) ) )
- (setq p6 (mapcar '+ p0 '(300 120 0) ) )
-
- (setq lst (list p1 p2) )
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(8 . "0") '(62 . 0) (cons 90 (length lst) ) '(70 . 1) )
- (mapcar '(lambda (pt) (cons 10 pt) ) lst) ) )
-
- (setq lst (list p3 p4) )
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(8 . "0") '(62 . 0) (cons 90 (length lst) ) '(70 . 1) )
- (mapcar '(lambda (pt) (cons 10 pt) ) lst) ) )
-
- (setq lst (list p1 p5) )
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(8 . "0") '(62 . 0) (cons 90 (length lst) ) '(70 . 1) )
- (mapcar '(lambda (pt) (cons 10 pt) ) lst) ) )
- )
p1~p6为无规律的坐标点,需要两两连线,用以上代码的方式写下来的话会很冗长,求精简的写法,谢谢~
|