Hi,
I try to update linear dimension distance scale.
I want to update linear dimensions over a detail (layout) which its scale have been changed.
When I use RhinoObject.CommitChanges(), visually it seems ok but as soon as I move the linear dimension (drag), the old value comes back.
The change doesn’t seem to stick.
Did I miss something ?
Here is my short python code.
import Rhino
import Rhino.Geometry as rg
import rhinoscriptsyntax as rs
def DimSetDistanceScale():
lst_id = rs.GetObjects("Select objects", rs.filter.annotation, True, True, True)
scale = rs.RealBox("Enter a scale: ", 1.0)
for id in lst_id:
ro = rs.coercerhinoobject(id)
if isinstance(ro.Geometry, rg.LinearDimension):
print("{0} -> {1}".format(ro.Geometry.DistanceScale, scale))
ro.Geometry.DistanceScale = scale
ro.CommitChanges()
rs.Redraw()
DimSetDistanceScale()
Regards
3 posts - 3 participants