谁能实现点击三角形中间,程序将自动画一条垂线,并显示垂线和底边的长度
本帖最后由 hhaoma 于 2014-8-24 18:31 编辑如题 谢谢大家了!
;; 需要e派工具箱(XCAD)的支持
(defun c:tt ()
(if (setq p1 (getpoint "\n基点<退出>: "))
(progn
(bpoly p1)
(setq s1(entlast)
p8 (xyp-9pt s1 8)
ptn (xyp-get-Vertexs s1 0)
pt (xyp-Get-PtNearPtn p8 ptn)
ptn (vl-remove-if '(lambda (x) (equal x pt)) ptn)
p1 (car ptn)
p2 (cadr ptn)
rad (angle p1 p2)
p3 (inters p1 p2 pt (polar pt (+ rad (* pi 0.5)) 10) nil)
s2 (xyp-line pt p3)
d1 (distance p1 p2)
dh (distance pt p3)
s3(xyp-Text 5 (xyp-Mid2Pt pt p3) (rtos dh 2 2))
s4 (xyp-Text 5 (xyp-Mid2Pt p1 p2) (rtos d1 2 2))
)
(entdel s1)
)
)
(princ)
)
需要AutoLISP来实现 有谁会呢?
(defun c:tt ()
(if (setq p1 (getpoint "\n基点<退出>: "))
(progn
(bpoly p1)
(setq s1 (entlast)
pt (vlax-curve-getclosestpointto s1 p1)
)
(entdel s1)
(command "line" "non" p1 "non" pt "")
)
)
(princ)
) xyp1964 发表于 2014-8-24 17:50 static/image/common/back.gif
这实力 太厉害啊!
页:
[1]