Create 2d Rectangle in RhinoCommon

Hi all,

there is a

Rhino.Display.DisplayPipeline.Draw2dRectangle()

and it ask for a type “Rectangle”

Draw2dRectangle(self: DisplayPipeline, rectangle: Rectangle, strokeColor: Color, thickness: int, fillColor: Color)

But in RhinoCommon is only

Rhino.Geometry.Rectangle3d()

Which is type “Rectangle3d” and not “Rectangle”.

How can the object of the type “Rectangle” be created ?.

Hi @flokart, try like this:

import System

location = System.Drawing.Point(10,10)
size = System.Drawing.Size(200, 200)
rect = System.Drawing.Rectangle(location, size)

print type(rect)

You*ll find Rectangle here.
_
c.

Oh man,

i tried that before but printed.

print rect.GetType()

and got

System.Drawing.Rectangle

and was confused…so thanks for clerification.