Create Method (Document, FabricationServiceButton, Int32, ElementId)


Creates a fabrication part element based on button.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2016

Syntax

C#
public static FabricationPart Create(
	Document document,
	FabricationServiceButton button,
	int condition,
	ElementId levelId
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	button As FabricationServiceButton, _
	condition As Integer, _
	levelId As ElementId _
) As FabricationPart
Visual C++
public:
static FabricationPart^ Create(
	Document^ document, 
	FabricationServiceButton^ button, 
	int condition, 
	ElementId^ levelId
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
button
Type: Autodesk.Revit.DBFabricationServiceButton
The fabrication service button to use.
condition
Type: SystemInt32
The condition index.
levelId
Type: Autodesk.Revit.DBElementId
The element identifier associated with the Level the FabricationPart will be created on.

Return Value

The new fabrication part.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException Fabrication service button contains invalid fittings. -or- Please use FabricationPart.CreateHanger to create fabrication hanger. -or- The ElementId levelId is not a Level.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException The index condition is not larger or equal to 0 and less than ConditionCount.
Autodesk.Revit.ExceptionsInvalidOperationException The fabrication part type does not exist. Reload the service using FabricationConfiguration.LoadServices.

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 →