Global |
public static GlobalParameter Create( Document document, string name, ForgeTypeId specTypeId )
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. -or- name is an empty string. -or- name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- A global parameter with the given name already exists in the document. -or- specTypeId is not a spec identifier. |
ArgumentNullException | A non-optional argument was null |
Each global parameter must have a valid name that is unique within the document. To test whether a name is unique, use the IsUniqueName(Document, String) method.
While global parameters can be created with almost any type of data, there is a few types that are not currently supported, such as the ElementId type. Programmers can test whether a particular data type is appropriate for a global parameter by using the [!:SpecUtils.IsSpec(ForgeTypeId)] method.
Parameters are created as non-reporting initially, but programmers are free to modify the IsReporting property once a global parameter is created and happens to be of a type eligible for reporting.