Finds whether a global parameter with the given name exists in the input document.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public static ElementId FindByName(
Document document,
string name
)
Parameters
- document Document
-
The document expected to contain the global parameter.
- name String
-
Name of the global parameter
Return Value
ElementId
ElementId of the parameter element, or InvalidElementId if it was not found.
Exceptions
Remarks
No exception is thrown when no parameter with such a name exists in the document;
instead, the method returns an ElementId.InvalidElementId.
Example
C#
public ElementId GetGlobalParameterByName(Document document, String name)
{
if (GlobalParametersManager.AreGlobalParametersAllowed(document))
{
return GlobalParametersManager.FindByName(document, name);
}
return ElementId.InvalidElementId;
}
VB
Public Function GetGlobalParameterByName(document As Document, name As [String]) As ElementId
If GlobalParametersManager.AreGlobalParametersAllowed(document) Then
Return GlobalParametersManager.FindByName(document, name)
End If
Return ElementId.InvalidElementId
End Function
See Also
Reference