明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1585|回复: 3

[求助]如何判断某一尺寸标注样式是否存在。若不存在,则新建该尺寸标注样式?

[复制链接]
发表于 2005-6-23 10:43:00 | 显示全部楼层 |阅读模式
如何判断某一尺寸标注样式是否存在。若不存在,则新建该尺寸标注样式?
发表于 2005-6-23 12:02:00 | 显示全部楼层
(defun mychangebiaozhu ()
(if (tblobjname "DIMSTYLE" "iso-25")
(command "dimstyle" "r" "iso-25")
(command "dimstyle" "S" "iso-25")
)
(setvar "dimdec" 0)
(setvar "dimtmove" 2)
(setvar "dimcen" (/ 2 *myrate*))
(if (not (tblobjname "DIMSTYLE" (rtos (/ 1 *myrate*) 2 0)))
(command "dimstyle" "S" (rtos (/ 1 *myrate*) 2 0))
)
(if (tblobjname "DIMSTYLE" "iso-25")
(command "dimstyle" "r" "iso-25")
(command "dimstyle" "S" "iso-25")
)
(setq a (tblobjname "DIMSTYLE" (rtos (/ 1 *myrate*) 2 0))
b (entget a)
b (subst (cons 44 (/ 2 *myrate*)) (assoc 44 b) b)
b (subst (cons 46 (/ 2 *myrate*)) (assoc 46 b) b)
b (subst (cons 140 (/ 3.5 *myrate*)) (assoc 140 b) b)
b (subst (cons 5 "_ARCHTICK") (assoc 5 b) b)
b (subst (cons 41 (/ 2 *myrate*)) (assoc 41 b) b)
b (subst (cons 43 (/ 4.5 *myrate*)) (assoc 43 b) b)
b (subst (cons 77 1) (assoc 77 b) b)
b (subst (cons 280 0) (assoc 280 b) b)
b (subst (cons 147 (/ 1.2 *myrate*)) (assoc 147 b) b)
b (subst (cons 73 0) (assoc 73 b) b)
b (subst (cons 74 0) (assoc 74 b) b)
b (subst (cons 271 0) (assoc 271 b) b)
b (subst (cons 146 1.0) (assoc 146 b) b)
)
(entmod b)
(command "dimstyle" "r" (rtos (/ 1 *myrate*) 2 0))
(princ)
) 这是我程序的一部分,你自己看看吧!也许对你有启发!
 楼主| 发表于 2005-6-23 14:59:00 | 显示全部楼层
谢谢!!!
发表于 2005-6-24 12:00:00 | 显示全部楼层
0451doctor 先生,太感谢了!但我想创建的样式如下,请问如编程?
(1)第一个箭头及第二箭头均为“Dot”,且箭头大小为0.5;
(2)尺寸线上方超出尺寸界线的距离为0,从定义标注的原点到尺寸界线起点的偏移距离为0;
(3)标注文字高度为1.25,文本垂直位置为“Above",文本水平位置为“Centerd",文本对齐方式为“Aligned with dimension line";
(4)尺寸文本的十进制精度为3位,十进制分隔符为“.”。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 16:50 , Processed in 0.177842 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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