GlobalParametersManager.GetAllGlobalParameters
Method
Description:
Returns all global parameters available in the given document.
Returns all global parameters available in the given document.
Examples
/// <summary>
/// Returns all global parameter elements defined in the given document.
/// </summary>
/// <param name="document">Revit project document.</param>
/// <returns>A set of ElementIds of global parameter elements</returns>
public ISet<ElementId> GetAllGlobalParameters(Document document)
{
// Global parameters are not available in all documents.
// They are available in projects, but not in families.
if (GlobalParametersManager.AreGlobalParametersAllowed(document))
{
return GlobalParametersManager.GetAllGlobalParameters(document);
}
// return an empty set if global parameters are not available in the document
return new HashSet<ElementId>();
}
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document containing the global parameters |
Return Value
Type | Description |
---|---|
ISet | A collection of Element Ids of global parameter elements. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | Global parameters are not supported in the given document. A possible cause is that it is not a project document, for global parameters are not supported in Revit families. |
ArgumentNullException | A non-optional argument was null |