Click or drag to resize

RectangleConverterToRectangle Method (Rectangle)

Converts the specified Rectangle to an equivalent Autodesk.Revit.DB.Rectangle.

Namespace:  RhinoInside.Revit.Convert.System.Drawing
Assembly:  RhinoInside.Revit (in RhinoInside.Revit.dll) Version: 1.7.8130
Syntax
public static Autodesk.Revit.DB.Rectangle ToRectangle(
	this Rectangle rectangle
)

Parameters

rectangle
Type: System.DrawingRectangle
System rectangle to convert.

Return Value

Type: Autodesk.Revit.DB.Rectangle
Revit rectangle that is equivalent to the provided System rectangle.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Rectangle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
Using ToRectangle(Rectangle) as extension method:
using System.Drawing;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Drawing;

DB.Rectangle revitRectangle = rectangle.ToRectangle();
Using ToRectangle(Rectangle) as static method:
using System.Drawing;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Drawing;

DB.Rectangle revitRectangle = RectangleConverter.ToRectangle(rectangle)
See Also