- (defun c:tt (/ p1 p2 ms lm c:callback olderr myerr)
- (defun myerr (msg)
- (redraw)
- (hfb_pointmonitor)
- (princ)
- )
- (defun c:callback (dynpt / sp ep v pp)
- (redraw)
- (setq sp (vlax-curve-getstartpoint ln)
- ep (vlax-curve-getendpoint ln)
- v (mapcar '- ep sp)
- )
- (setq pp (trans (mapcar '- dynpt sp) 0 v)
- pp (polar sp (angle sp ep) (last pp))
- )
- (grdraw (trans dynpt 0 1) (trans pp 0 1) 1 0)
- (vlax-put ln 'Endpoint pp)
- )
- (if (and (setq p1 (getpoint "\nStart Point: "))
- (setq p2 (getpoint p1 "\nEnd Point: "))
- )
- (progn
- (setq olderr *error*
- *error* myerr
- )
- (hfb_pointmonitor)
- (setq ms (vla-get-modelspace
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (setq ln (vlax-invoke ms 'Addline (trans p1 1 0) (trans p2 1 0)))
- (hfb_pointmonitor "C:callback")
- (while (setq p (getpoint "\nNext Point: "))
- (setq ln (vlax-invoke
- ms
- 'Addline
- (vlax-curve-getendpoint ln)
- (trans p 1 0)
- )
- )
- )
- (hfb_pointmonitor)
- (redraw)
- (setq *error* olderr)
- )
- )
- (princ)
- )
|