(defun c:TT (/ E D P X)
(if (and (setq E (entsel))
(setq D (getdist "\n指定长度: "))
)
(progn
(setq P (trans (cadr E) 1 0)
E (car E)
P (vlax-curve-getClosestPointTo E P)
X (vlax-curve-getFirstDeriv E (vlax-curve-getParamAtPoint E P))
X (angle '(0 0 0) X)
X (polar P X D)
)
(entmake (list '(0 . "LINE") (cons 10 P) (cons 11 X)))
)
)
(princ)
)