RebarShapeParameters.GetOrCreateElementIdForExternalDefinition
Method
Description:
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.
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.
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 with this method.
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.
Syntax
public static ElementId GetOrCreateElementIdForExternalDefinition(
Document doc,
ExternalDefinition externalDefinition
)
Parameters
Parameter | Type | Description |
---|---|---|
doc | Document | A document. |
externalDefinition | ExternalDefinition | A shared parameter. |
Return Value
Type | Description |
---|---|
ElementId | An ElementId representing the shared parameter stored in the document. |
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was. |