Create Method (Document, FabricationServiceButton, Double, Double, ElementId)


Creates a fabrication part element based on button and size.

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

Syntax

C#
public static FabricationPart Create(
	Document document,
	FabricationServiceButton button,
	double width,
	double depth,
	ElementId levelId
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	button As FabricationServiceButton, _
	width As Double, _
	depth As Double, _
	levelId As ElementId _
) As FabricationPart
Visual C++
public:
static FabricationPart^ Create(
	Document^ document, 
	FabricationServiceButton^ button, 
	double width, 
	double depth, 
	ElementId^ levelId
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document.
button
Type: Autodesk.Revit.DB FabricationServiceButton
The fabrication service button to use. Matches button condition based on the specified size.
width
Type: System Double
The width of the part. Units are in feet (ft).
depth
Type: System Double
The depth of the part. Units are in feet (ft). It should be equal to width for round part.
levelId
Type: Autodesk.Revit.DB ElementId
The level identifier.

Return Value

The new fabrication part.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException Fabrication service button contains invalid fittings. -or- Please use FabricationPart.CreateHanger to create fabrication hanger.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException The fabrication part type does not exist. Reload the service using FabricationConfiguration.LoadServices. -or- failing to match a button condition based on specific size.

See Also