How do I change the annotated model space scaling ratio?


How do I change this value in python?

Hi @aws, below example change a dimension’s model space scale value to 2.5 using IronPython in Rhino 7:

#! python 2

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

def DoSomething():

    dim_id = rs.GetObject("Dimension", rs.filter.annotation, True, False)
    if not dim_id: return
    
    dim_obj = rs.coercerhinoobject(dim_id, True, True)
    if not isinstance(dim_obj, Rhino.DocObjects.DimensionObject): return
    
    dim_obj.Geometry.DimensionScale = 2.5
    dim_obj.CommitChanges()
    
    scriptcontext.doc.Views.Redraw()

DoSomething()

_
c.

I am very grateful to you, this problem has troubled me for about half a month