[Bug] GetBoxMode in RhinoGet.GetRectangle is used incorrectly in RhinoCommon


(Menno Deij - van Rijswijk) #1

If I use a certain GetBoxMode, its actual result is by the following table

GetBoxMode.Center     => GetBoxMode.Corner
GetBoxMode.Corner     => GetBoxMode.ThreePoint
GetBoxMode.ThreePoint => GetBoxMode.Vertical
GetBoxMode.Vertical   => GetBoxMode.Center

That is, If I use Corner, the behavior of RhinoGet.GetRectangle is ThreePoint.

I use it like this:

Point3d[] corners;
Result r = RhinoGet.GetRectangle(GetBoxMode.Center, Point3d.Unset, new[]{"1", "2", "3", "4"}, out corners);

I have the suspicion that the enum value gets translated incorrectly.

Also: if I set the prompts variable to null (which according to the Intellisense I should be able to do) I get a NullReferenceException.


(Steve Baer) #2

Yep, it is a bug. I am working on the fix right now and will include this in SR6.
Thanks for finding it.