替换标注样式中的文字样式
本帖最后由 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)
)
似乎这样不可以,求助。
本帖最后由 zhynt 于 2011-6-27 11:03 编辑
----写错了,已删除。---------------------------------------
贴一个相近的例子
;;;批量修改标注文安标高
(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)
)
不用管样式,只看标注实例 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 组中指定的图元名的数据库信息
如何跟新,求助。 已解决
(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)
) 好像有点门道了,如何改标注的图层了?
页:
[1]