 - (defun c:tt ()
- "tt(两端画线)"
- (defun abc (s1 / p1 p2 r1 r2 l1 l2)
- (setq p1 (vlax-curve-getStartPoint s1)
- p2 (vlax-curve-getEndPoint s1)
- )
- (if (not (equal p1 p2 1e-3))
- (setq r1 (xyp-AngleAtPoint s1 p1)
- r2 (xyp-AngleAtPoint s1 p2)
- l1 (xyp-Line p1 (polar p1 r1 (- dd)))
- l2 (xyp-Line p2 (polar p2 r2 dd))
- )
- )
- )
- (setq dd (Udist 7 "" "线长<输入或鼠标直接量取>" dd nil))
- (setq i -1)
- (if (setq ss (ssget '((0 . "*line,arc"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (abc s1)
- )
- )
- (princ)
- )
|