Modify dimension text attributes¶
Modify dimension text attributes¶
1# Find all dimensions in this block and make them use a standard size and font
2# Note that it's often better to use dimension master tool settings to acheive this.
3
4if not impact.active_drawing.isNone():
5 font = impact.system.fonts.item("Verdana")
6 if not font.isNone():
7 ab = impact.active_drawing.active_layer.active_block
8 for ent in ab.entities:
9 if ent.entity_type == ipEntityType.etDimension:
10 ent_casted = IDimension(ent._com_obj)
11
12 # not all dimensions have a text part, so check which type this is
13 if ent_casted.dimension_type != ipDimensionType.dtCentre:
14 ent_casted.text_height = 10
15 ent_casted.text_width = 8
16 ent_casted.font = font