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)

public static void CreateRectangle(
Document document,
ReferencePoint startPoint,
ReferencePoint endPoint,
CurveProjectionType projectionType,
bool boundaryReferenceLines,
bool boundaryCurvesFollowSurface,
out IList<ElementId> createdCurvesIds,
out IList<ElementId> createdCornersIds
)
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 IList ElementId
- Created rectangle's boundary curves ids.
- createdCornersIds IList ElementId
- 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.
