Revit 2025 API
Rebar |
Retrieve the ElementId corresponding to an external rebar shape parameter
in the document, if it exists; otherwise, add the parameter to the document
and generate a new ElementId.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static ElementId GetOrCreateElementIdForExternalDefinition( Document doc, ExternalDefinition externalDefinition )
Public Shared Function GetOrCreateElementIdForExternalDefinition ( doc As Document, externalDefinition As ExternalDefinition ) As ElementId
public: static ElementId^ GetOrCreateElementIdForExternalDefinition( Document^ doc, ExternalDefinition^ externalDefinition )
static member GetOrCreateElementIdForExternalDefinition : doc : Document * externalDefinition : ExternalDefinition -> ElementId
Parameters
- doc Document
- A document.
- externalDefinition ExternalDefinition
- A shared parameter.
Return Value
ElementIdAn ElementId representing the shared parameter stored in the document.

Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was . |

Before a parameter can be used in a RebarShapeDefinition, it must
exist in the definition's document. There are two ways to achieve this.
It can be bound to one or more categories in the document using
the Document.ParameterBindings property, or it can be created with this
method.
See Also