剖面孔倒角lisp
学习了lisp,作了一个剖面孔倒角的lisp小工具,传上来让大家指点一下,就是说指指点点吧!(defun C:kdj () ;剖面孔倒角2011-1-23
(setq cm (getvar "cmdecho") bl (getvar "blipmode") )
(setvar "cmdecho" 0) (setvar "blipmode" 0)
(setq L1(entsel"\n选择孔径的边线:")
p10 (osnap (cadr L1) "mid")
p11 (osnap (cadr L1) "endp")
L2(entsel"\n选择孔径的另一边线:")
p20 (osnap (cadr L2) "mid")
p21 (osnap (cadr L2) "endp")
L0(entsel"\n选择孔端面线:")
en(car L0)
el(entget en)
p01 (cdr (assoc 10 el));线段的起点
p02 (cdr (assoc 11 el));线段的终点
p11 (inters p10 p11 p01 p02 nil)
P21 (inters p20 p21 p01 p02 nil)
D (getdist "\n输入倒角尺寸 :")
a0 (angle p11 p10);孔轴向角度
a1 (angle p11 p21);孔径向角度
p12(polar p11 a0 D)
p13(polar p11 (+ a1 3.141592) D)
p22(polar p21 a0 D)
p23(polar p21 a1 D)
)
(setq os(getvar "osmode"))
(setvar "osmode" 0)
(command "line" p12 p22 "")
(setq first(entlast) )
(command "fillet""r" 0 )
(command "fillet" first P10 )
(command "fillet" first P20 )
(command"line" p12 p13 """line" p22 p23 "")
(setvar "osmode" os)
(setvar "cmdecho" cm)
(setvar "blipmode" bl)
(princ)
) 好东西 谢谢楼主 我不是学机械的,不过好东西也要支持一下,顶 好东西 谢谢分享 剖面孔倒角lisp (续)
为方便了解此小工具,上传一附图。 不错~。多谢楼主分享~
页:
[1]