明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1715|回复: 2

[求助][LISP]關於尺寸換算的2個命令自動化

[复制链接]
发表于 2005-5-28 13:39:00 | 显示全部楼层 |阅读模式
由於工作中经常接触各类图纸,公英制都有,经常需要换算尺寸,因此我编制了以下2个lisp命令来避免频繁的修改尺寸属性,DTI 是在公制图纸中将尺寸增加英制换算的命令,DTM 则是在英制图纸中将尺寸增加公制换算的命令,请哪位帮忙,将之合并成一个命令,自动判断当前尺寸的公制英制并追加相对应的换算单位,谢谢! (defun c:dti ()
(setvar "cmdecho" 0)
(command "dimoverride"
"DIMalt"
"1"
"dimaltF"
"0.03937007874015748031496062992126"
"dimaltu"
"7"
"dimapost"
"\""
"dimaltd"
"4"
""
(ssget)
""
)
(PRINC)
) (defun c:dtm ()
(setvar "cmdecho" 0)
(command "dimoverride"
"DIMalt"
"1"
"dimaltu"
"2"
"dimaltd"
"1"
"dimaltF"
"25.4"
"DIMZIN"
"8"
"dimapost"
"mm"
""
(ssget)
""
)
(PRINC)
)
 楼主| 发表于 2005-6-1 07:57:00 | 显示全部楼层
怎麼沒人幫忙啊?
发表于 2005-6-1 08:42:00 | 显示全部楼层
加上IF 判决就解决了 , 题外话. 怎么楼主也和我一样用繁体操作系统啊. (DEFUN C:DTI()
(SETVAR "CMDECHO"0)
(IF (= (GETVAR "MEASUREMENT")1)
(VL-CMDF "dimoverride""DIMalt""1""dimaltF"
"0.03937007874015748031496062992126"
"dimaltu" "7""dimapost" "\"""dimaltd" "4" ""(ssget "X") "")
(command "dimoverride""DIMalt""1""dimaltu"
"2" "dimaltd""1" "dimaltF" "25.4" "DIMZIN" "8""dimapost" "mm" "" (ssget "X") "")
)
(SETVAR "CMDECHO"1)
(PRINC))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-17 10:24 , Processed in 0.174465 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表