CreateRectangle Method


Creates rectangle on face or sketchplane for two given diagonal points.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2012

Syntax

C#
public static void CreateRectangle(
	Document document,
	ReferencePoint startPoint,
	ReferencePoint endPoint,
	CurveProjectionType projectionType,
	bool boundaryReferenceLines,
	bool boundaryCurvesFollowSurface,
	out IList<ElementId> createdCurvesIds,
	out IList<ElementId> createdCornersIds
)
Visual Basic
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) _
)
Visual C++
public:
static void CreateRectangle(
	Document^ document, 
	ReferencePoint^ startPoint, 
	ReferencePoint^ endPoint, 
	CurveProjectionType projectionType, 
	bool boundaryReferenceLines, 
	bool boundaryCurvesFollowSurface, 
	[OutAttribute] IList<ElementId^>^% createdCurvesIds, 
	[OutAttribute] IList<ElementId^>^% createdCornersIds
)

Parameters

document
Type: Autodesk.Revit.DB Document
The Document.
startPoint
Type: Autodesk.Revit.DB ReferencePoint
First diagonal point of rectangle.
endPoint
Type: Autodesk.Revit.DB ReferencePoint
Second diagonal point of rectangle.
projectionType
Type: Autodesk.Revit.DB 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
Type: System Boolean
True if rectangle's boundary curves should be reference lines, false otherwise.
boundaryCurvesFollowSurface
Type: System Boolean
True if rectangle's boundary curves should follow surface, false otherwise.
createdCurvesIds
Type: System.Collections.Generic IList ElementId %
Created rectangle's boundary curves ids.
createdCornersIds
Type: System.Collections.Generic IList ElementId %
Ids of two newly created corner points.

Remarks

This array contains the ElementIds of the two additional corner points that are created to complete the rectangle.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentOutOfRangeException Unexpected projection type. -or- A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.Exceptions InvalidOperationException Unable to create rectangle.

See Also