GlobalParametersManagerFindByName Method |
Finds whether a global parameter with the given name exists in the input document.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static ElementId FindByName(
Document document,
string name
)
Public Shared Function FindByName (
document As Document,
name As String
) As ElementId
public:
static ElementId^ FindByName(
Document^ document,
String^ name
)
static member FindByName :
document : Document *
name : string -> ElementId
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
public ElementId GetGlobalParameterByName(Document document, String name)
{
if (GlobalParametersManager.AreGlobalParametersAllowed(document))
{
return GlobalParametersManager.FindByName(document, name);
}
return ElementId.InvalidElementId;
}
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
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also