- 积分
- 1699
- 明经币
- 个
- 注册时间
- 2019-12-18
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
此为沉头孔插件,改成非标和国标的都能用,包括椭圆孔,麻烦大佬们帮忙改下,谢谢!
(defun c:dw (/ en_data en txt diam v1 v2 v3)
(setq v1 (getvar "dimtoh"))
(setq v2 (getvar "dimtih"))
(setq v3 (getvar "dimtad"))
(setq en (entsel "\n选择孔!")
en_data (entget (car en))
)
(setq diam (* 2 (cdr (assoc 40 en_data))))
(cond ((equal diam 5.0 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C5\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C8\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;4.5}"
)
)
((equal diam 6.0 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C6\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C10\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;6}"
)
)
((equal diam 7.0 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C7\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C11\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;7}"
)
)
((equal diam 9.0 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C9\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C14\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;9}"
)
)
((equal diam 3.5 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C3.5\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C6.5\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;3.5}"
)
)
((equal diam 11 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C11\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C17\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;11}"
)
)
((equal diam 14 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C14\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C20\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;14}"
)
)
((equal diam 18 0.05)
(setq txt
"\\pxsm1.05,qc;2-%%C14\\P{\\Fgdt|c134;\\W0.7;\\Ov\\Fgbenor,gbcbig|c134;\\W1;%%C28\\Fgdt|c134;x\\Fgbenor,gbcbig|c134;18}"
)
)
)
(setvar "dimtih" 0)
(setvar "dimtoh" 1)
(setvar "dimtad" 0)
(command "dimdiameter" en "m" txt pause)
(setvar "dimtih" v1)
(setvar "dimtoh" v2)
(setvar "dimtad" v3)
(princ)
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|