- (defun c:test ()
- ;(CMDLA0)
- (setq pt1 (getpoint "\n点 : ")
- pt2 (getpoint pt1 "\n方向 : ")
- s1 (car (entsel "\n选择实体"))
- )
- (command "line" pt1 pt2 "")
- (setq s2 (entlast))
- (setq pt (vlax-safearray->list
- (vlax-variant-value
- (vla-intersectwith
- (vlax-ename->vla-object s2)
- (vlax-ename->vla-object s1)
- acExtendthisentity
- )
- )
- )
- pt (list (car pt)(cadr pt))
- )
- (entdel s2)
- (grdraw pt1 pt 1)
- (princ "\距离 = ")
- (princ (distance pt1 pt))
- ;(command "line" pt1 pt "")
- ;(CMDLA1)
- )
|