Create Method


Create a MultiSegmentGrid element from the specified curve loop.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2013

Syntax

C#
public static ElementId Create(
	Document document,
	ElementId typeId,
	CurveLoop curveLoop,
	ElementId sketchPlaneId
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	typeId As ElementId, _
	curveLoop As CurveLoop, _
	sketchPlaneId As ElementId _
) As ElementId
Visual C++
public:
static ElementId^ Create(
	Document^ document, 
	ElementId^ typeId, 
	CurveLoop^ curveLoop, 
	ElementId^ sketchPlaneId
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document in which to create the MultiSegmentGrid.
typeId
Type: Autodesk.Revit.DB ElementId
Element id of a GridType element.
curveLoop
Type: Autodesk.Revit.DB CurveLoop
An open curve loop consisting of lines and arcs.
sketchPlaneId
Type: Autodesk.Revit.DB ElementId
Element id of a SketchPlane for the curves elements that will be created from the curveLoop.

Return Value

The element id of the new MultiSegmentGrid element.

Remarks

For each curve in the curve loop, a corresponding Grid will be created.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The element id should refer to a valid horizontal SketchPlane. -or- The element id should refer to a GridType element. -or- The curve loop should be an open loop consisting of lines and arcs.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).
Autodesk.Revit.Exceptions ModificationForbiddenException The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.
Autodesk.Revit.Exceptions ModificationOutsideTransactionException The document has no open transaction.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →