-
Beta Was this translation helpful? Give feedback.
Answered by
CEXT-Dan
Mar 24, 2025
Replies: 1 comment 1 reply
-
Generally, you would work through the dimension style or a dimension override from pyrx import Rx, Ge, Gi, Db, Ap, Ed, Ax, command
# https://www.keanw.com/2009/09/creating-and-overriding-autocad-dimension-styles-using-net.html
# change the dimstyle
@command
def doit1():
db = Db.curDb()
dimStyle = Db.DimStyleTableRecord(db.dimstyle(), Db.OpenMode.kForWrite)
old = dimStyle.dimclrt()
clr = Db.Color()
clr.setColorIndex(1)
dimStyle.setDimclrt(clr)
print(dimStyle.getName(), old, dimStyle.dimclrt())
# add dim override
@command
def doit2():
ps, id, _ = Ed.Editor.entSel("\nSelect:", Db.Dimension.desc())
if ps != Ed.PromptStatus.eOk:
return
dim = Db.Dimension(id, Db.OpenMode.kForWrite)
# todo check if there's aready a dimstyle override
# 178 = dimclrt
# 1 is red
xd = [(1001, "ACAD"), (1000, "DSTYLE"), (1002, "{"), (1070, 178), (1070, 1), (1002, "}")]
dim.setXData(xd) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gswifort
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generally, you would work through the dimension style or a dimension override
try the override