Revit 2025 API
Curve |
Creates rectangle on face or sketchplane for two given diagonal points.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static void CreateRectangle( Document document, ReferencePoint startPoint, ReferencePoint endPoint, CurveProjectionType projectionType, bool boundaryReferenceLines, bool boundaryCurvesFollowSurface, out IList<ElementId> createdCurvesIds, out IList<ElementId> createdCornersIds )
Public Shared Sub CreateRectangle ( document As Document, startPoint As ReferencePoint, endPoint As ReferencePoint, projectionType As CurveProjectionType, boundaryReferenceLines As Boolean, boundaryCurvesFollowSurface As Boolean, <OutAttribute> ByRef createdCurvesIds As IList(Of ElementId), <OutAttribute> ByRef createdCornersIds As IList(Of ElementId) )
public: static void CreateRectangle( Document^ document, ReferencePoint^ startPoint, ReferencePoint^ endPoint, CurveProjectionType projectionType, bool boundaryReferenceLines, bool boundaryCurvesFollowSurface, [OutAttribute] IList<ElementId^>^% createdCurvesIds, [OutAttribute] IList<ElementId^>^% createdCornersIds )
static member CreateRectangle : document : Document * startPoint : ReferencePoint * endPoint : ReferencePoint * projectionType : CurveProjectionType * boundaryReferenceLines : bool * boundaryCurvesFollowSurface : bool * createdCurvesIds : IList<ElementId> byref * createdCornersIds : IList<ElementId> byref -> unit
Parameters
- document Document
- The Document.
- startPoint ReferencePoint
- First diagonal point of rectangle.
- endPoint ReferencePoint
- Second diagonal point of rectangle.
- projectionType CurveProjectionType
- Projection type of rectangle's boundary curves. If the rectangle input points are Face hosted, and CurveProjectionType::ParallelToLevel is requested, and the Face normal at the location of the start point is at a less than 45 degree angle with the level planes, then the projectionType will be set to FromTopDown, even if ParallelToLevel was requested.
- boundaryReferenceLines Boolean
- True if rectangle's boundary curves should be reference lines, false otherwise.
- boundaryCurvesFollowSurface Boolean
- True if rectangle's boundary curves should follow surface, false otherwise.
- createdCurvesIds IListElementId
- Created rectangle's boundary curves ids.
- createdCornersIds IListElementId
- Ids of two newly created corner points.
| Exception | Condition |
|---|---|
| ArgumentNullException | A non-optional argument was null |
| ArgumentOutOfRangeException | Unexpected projection type. -or- A value passed for an enumeration argument is not a member of that enumeration |
| InvalidOperationException | Unable to create rectangle. |
This array contains the ElementIds of the two additional corner points that are created to complete the rectangle.
See Also