Annotation Style

I am looking for a script to change the annotation style. I started one but can’t figure out how to change 2 things. Can someone tell me how to change them or write me a script so i can add it to the one i have?
I want to change the text fit to inside and the unit formats to Inches-decimal. See pics.

Hi @Harold1,

All of the dimension style properties are listed here:

https://developer.rhino3d.com/api/RhinoCommon/html/Properties_T_Rhino_DocObjects_DimensionStyle.htm

import Rhino
import scriptcontext as sc

def test_modify_default_dimstyle():
    old_style = sc.doc.DimStyles.Find('Default', True)
    if old_style:
        new_style = old_style.Duplicate()
        is_modified = False
        if new_style.DimensionLengthDisplay != Rhino.DocObjects.DimensionStyle.LengthDisplay.InchesDecimal:
            new_style.DimensionLengthDisplay = Rhino.DocObjects.DimensionStyle.LengthDisplay.InchesDecimal
            is_modified = True
        if new_style.FitText != Rhino.DocObjects.DimensionStyle.TextFit.TextInside:
            new_style.FitText = Rhino.DocObjects.DimensionStyle.TextFit.TextInside
            is_modified = True
        if is_modified:
            sc.doc.DimStyles.Modify(new_style, old_style.Id, True)
            sc.doc.Views.Redraw()

if __name__ == "__main__":
    test_modify_default_dimstyle()    

– Dale

Thanks works good.

Any chance you can add Changing countermark Style to none?

Hi @Harold1,

Use DimensionStyle.CenterMarkType.

  • Dale

Thanks again