Bug report: LinearDimension is broken for vertical dimensions

Python on Mac. I’ve tried everything. It works from the UI, but not from Python.

# You must have a page active and then run the below.

# Works
# Horizontal dimension
start = Rhino.Geometry.Point3d(0, 0, 0)
end = Rhino.Geometry.Point3d(100, 0, 0)
mid = Rhino.Geometry.Point3d(50, 10, 0)
rs.AddLinearDimension(rs.WorldXYPlane(), start, end, mid)

# Degenerate result
# Vertical dimension
start = Rhino.Geometry.Point3d(0, 0, 0)
end = Rhino.Geometry.Point3d(0, 100, 0)
mid = Rhino.Geometry.Point3d(10, 50, 0)
rs.AddLinearDimension(rs.WorldXYPlane(), start, end, mid)

The above code results in this:


The horizontal dimension turns out ok, but the vertical dimension is degenerate.

If you make a ticket in your bugtracker, please link to it here. Thanks!

@Alain can you please investigate this one?

Hi Aske,

I know it’s not the most intuitive but what if you rotate the plane:

...
plane = rs.WorldXYPlane()
plane.Rotate(math.pi/2.0, Rhino.Geometry.Vector3d(0,0,1))
rs.AddLinearDimension(plane, start, end, mid)

Hey Alain,

That works as a workaround! The thought briefly occurred to me, but I wasn’t sure if the planes orientation was used, and I didn’t test it out. Thanks!

From a user perspective I would still consider it a bug: the API gives no indication that this method only works for none-vertical (in plane space) dimensions.

Unintuitive but at least it gives you a lot of flexibility.