- (defun c:tt (/ p1 p2 p3 e e1 e11 e2 e22)
- (setq p1 (getpoint "\n指定第一点"))
- (if (not p1)
- (vl-exit-with-value 0)
- )
- (setq p2 (getpoint p1 "\n指定第一点"))
- (if (not p2)
- (vl-exit-with-value 0)
- )
- (setq p3 (getpoint p2 "\n指定第一点"))
- (if (not p3)
- (vl-exit-with-value 0)
- )
- (setq e (Make-LWPOLYLINE (list p1 p2 p3)))
- (vla-Offset (vlax-ename->vla-object e) -65)
- (setq e1 (entlast))
- (vla-Offset (vlax-ename->vla-object e) 65)
- (setq e2 (entlast))
- (if (< (vlax-curve-getDistAtPoint e1 (vlax-curve-getEndPoint e1))
- (vlax-curve-getDistAtPoint e2 (vlax-curve-getEndPoint e2))
- )
- (entdel e2)
- (progn (entdel e1) (setq e1 e2))
- )
- (vla-Offset (vlax-ename->vla-object e) 150)
- (setq e11 (entlast))
- (vla-Offset (vlax-ename->vla-object e) -150)
- (setq e22 (entlast))
- (if (< (vlax-curve-getDistAtPoint e11 (vlax-curve-getEndPoint e11))
- (vlax-curve-getDistAtPoint e22 (vlax-curve-getEndPoint e22))
- )
- (entdel e22)
- (progn (entdel e11) (setq e11 e22))
- )
- (Make-LWPOLYLINE
- (list (vlax-curve-getStartPoint e) (vlax-curve-getStartPoint e11))
- )
- (Make-LWPOLYLINE
- (list (vlax-curve-getEndPoint e) (vlax-curve-getEndPoint e11))
- )
- )
- ;;167.3 [功能] Entmake点表生成多段线
- (defun Make-LWPOLYLINE (lst / PT)
- (entmakeX
- (append
- (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- (cons 90 (length lst))
- )
- (mapcar '(lambda (pt) (cons 10 pt)) lst)
- )
- )
- )
|