明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2869|回复: 5

替换标注样式中的文字样式

[复制链接]
发表于 2011-6-27 09:46:34 | 显示全部楼层 |阅读模式
本帖最后由 duotu007 于 2011-6-27 09:47 编辑

      (while (setq dxf (tblnext "Dimstyle" (not dxf)))
        (setq style (tblobjname "STYLE" "我的文字"))
        (setq dxf (subst (cons 340 style) (assoc 340 dxf) dxf))
        (entmod dxf)
      )
似乎这样不可以,求助。
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2011-6-27 11:02:34 | 显示全部楼层
本帖最后由 zhynt 于 2011-6-27 11:03 编辑

----写错了,已删除。---------------------------------------
发表于 2011-6-27 11:16:32 | 显示全部楼层
贴一个相近的例子
;;;批量修改标注文安标高
(defun c:sbz (/ n)
  (princ "\n选择要改文字高度的标注:")
  (vlax-for n (vla-get-textstyles (vla-get-activedocument (vlax-get-acad-object)))
    (if (= "DIM_FONT" (vla-get-name n))
        (progn
          (vla-put-fontfile n "gbenor.shx")
          (vla-put-bigfontfile n "GBCBIG.shx")
          (vla-put-width n 1.0)
        )
      ))
  (if
     (ssget "_X" '((0 . "DIMENSION")(3 . "DIMN")))
    (vlax-for n
                (vla-get-activeselectionset
                  (vla-get-activedocument (vlax-get-acad-object))
                )
      
      (VLA-put-textheight n 400)
    )
  )
  (princ)
)
不用管样式,只看标注实例
 楼主| 发表于 2011-6-27 17:02:36 | 显示全部楼层
entmod 函数更新由 elist 的 -1 组中指定的图元名的数据库信息
可标注样式
((0 . "DIMSTYLE") (2 . "大样100") (70 . 0) (3 . "") (4 . "") (5 . "ArchTick") (6
. "") (7 . "") (40 . 1.0) (41 . 120.0) (42 . 100.0) (43 . 120.0) (44 . 100.0)
(45 . 0.0) (46 . 100.0) (47 . 0.0) (48 . 0.0) (140 . 200.0) (141 . 0.09) (142 .
0.0) (143 . 25.4) (144 . 1.0) (145 . 0.0) (146 . 1.0) (147 . 60.0) (71 . 0) (72
. 0) (73 . 0) (74 . 0) (75 . 0) (76 . 0) (77 . 1) (78 . 0) (170 . 0) (171 . 2)
(172 . 1) (173 . 0) (174 . 1) (175 . 0) (176 . 4) (177 . 3) (178 . 65) (270 .
2) (271 . 0) (272 . 0) (273 . 2) (274 . 2) (340 . <图元名: 7ef64218>) (275 . 0)
(280 . 0) (281 . 0) (282 . 0) (283 . 1) (284 . 0) (285 . 0) (286 . 0) (287 . 5)
(288 . 0))
不含由 elist 的 -1 组中指定的图元名的数据库信息
如何跟新,求助。
 楼主| 发表于 2011-6-27 17:23:10 | 显示全部楼层
已解决
      (while (setq dxf (tblnext "Dimstyle" (not dxf)))
        (setq e1 (entget (tblobjname "dimstyle" (cdr (assoc 2 dxf)))))
        (setq e2 (tblobjname "style" b1))
        (setq ed (subst (cons 340 e2)(assoc 340 e1) e1))
        (entmod ed)
      )
发表于 2012-5-26 20:05:36 来自手机 | 显示全部楼层
好像有点门道了,如何改标注的图层了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-9-25 11:03 , Processed in 0.144882 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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