GetOrCreateDefaultRebarShape Method


Creates a new RebarShape object with a default name or returns existing one which fulfills Path Reinforcement bending data requirements.

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

Syntax

C#
public static ElementId GetOrCreateDefaultRebarShape(
	Document document,
	ElementId rebarBarTypeId,
	ElementId startRebarHookTypeId,
	ElementId endRebarHookTypeId
)
Visual Basic
Public Shared Function GetOrCreateDefaultRebarShape ( _
	document As Document, _
	rebarBarTypeId As ElementId, _
	startRebarHookTypeId As ElementId, _
	endRebarHookTypeId As ElementId _
) As ElementId
Visual C++
public:
static ElementId^ GetOrCreateDefaultRebarShape(
	Document^ document, 
	ElementId^ rebarBarTypeId, 
	ElementId^ startRebarHookTypeId, 
	ElementId^ endRebarHookTypeId
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
rebarBarTypeId
Type: Autodesk.Revit.DBElementId
The id of the RebarBarType.
startRebarHookTypeId
Type: Autodesk.Revit.DBElementId
The id of the RebarHookType for the start of the bar. If this parameter is InvalidElementId, it means to create a rebar with no start hook.
endRebarHookTypeId
Type: Autodesk.Revit.DBElementId
The id of the RebarHookType for the end of the bar. If this parameter is InvalidElementId, it means to create a rebar with no end hook.

Return Value

Rebar Shape id.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException rebarBarTypeId should refer to an RebarBarType element. -or- startRebarHookTypeId should be invalid or refer to an RebarHookType element. -or- endRebarHookTypeId should be invalid or refer to an RebarHookType element.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →