GetElementIdForExternalDefinition Method


Retrieve the ElementId corresponding to an external rebar shape parameter in the document, if it exists; otherwise, return InvalidElementId.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public static ElementId GetElementIdForExternalDefinition(
	Document doc,
	ExternalDefinition externalDefinition
)
Visual Basic
Public Shared Function GetElementIdForExternalDefinition ( _
	doc As Document, _
	externalDefinition As ExternalDefinition _
) As ElementId
Visual C++
public:
static ElementId^ GetElementIdForExternalDefinition(
	Document^ doc, 
	ExternalDefinition^ externalDefinition
)

Parameters

doc
Type: Autodesk.Revit.DB Document
A document.
externalDefinition
Type: Autodesk.Revit.DB ExternalDefinition
A shared parameter.

Return Value

An ElementId representing the shared parameter stored in the document, or InvalidElementId if the parameter is not stored in the document.

Remarks

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 by calling RebarShapeParameters.GetOrCreateElementIdForExternalDefinition().

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was a null reference ( Nothing in Visual Basic) .

See Also