ExternalDefinition
Description:
The ExternalDefinition object adds properties specific to Autodesk Revit shared parameter definitions.
The ExternalDefinition object adds properties specific to Autodesk Revit shared parameter definitions.
Remarks:
The ExternalDefinition object can be created by a definition Group object from a shared parameters file. External parameter definition must belong to a Group which is nothing more than a collection of shared parameter definitions. The following process should be followed to add a parameter to an element: Open the shared parameters file, via the Application.OpenSharedParameterFile() method. Access an existing or create a new group, via the DefinitionFile.Groups property. Access an existing or create a new external parameter definition, via the DefinitionGroup.Definitions property. Create a new Binding object with the categories to which the parameter will be bound using an InstanceBinding or a TypeBinding object. Finally add the binding and definition to the document using the Document.ParameterBindings object.
The ExternalDefinition object can be created by a definition Group object from a shared parameters file. External parameter definition must belong to a Group which is nothing more than a collection of shared parameter definitions. The following process should be followed to add a parameter to an element: Open the shared parameters file, via the Application.OpenSharedParameterFile() method. Access an existing or create a new group, via the DefinitionFile.Groups property. Access an existing or create a new external parameter definition, via the DefinitionGroup.Definitions property. Create a new Binding object with the categories to which the parameter will be bound using an InstanceBinding or a TypeBinding object. Finally add the binding and definition to the document using the Document.ParameterBindings object.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.Definition
Autodesk.Revit.DB.ExternalDefinition
System.Object
Autodesk.Revit.DB.Definition
Autodesk.Revit.DB.ExternalDefinition
public class ExternalDefinition : Definition,
IDisposable
private void ReadEditExternalParam(DefinitionFile file)
{
// get ExternalDefinition from shared parameter file
DefinitionGroups myGroups = file.Groups;
DefinitionGroup myGroup = myGroups.get_Item("MyGroup");
if (myGroup != null)
{
ExternalDefinition myExtDef = myGroup.Definitions.get_Item("MyParam") as ExternalDefinition;
if (myExtDef != null)
{
DefinitionGroup newGroup = myGroups.get_Item("AnotherGroup");
if (newGroup != null)
{
// change the OwnerGroup of the ExternalDefinition
myExtDef.OwnerGroup = newGroup;
}
}
}
}
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| Dispose() | None | Releases all resources used by the | |
| GetSpecTypeId() | ForgeTypeId | Gets the identifier of the spec describing values of the parameter. | Definition |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| Description | string | The description of the parameter. The description will be used as tooltip in the Revit UI including in the properties palette. | |
| GUID | Guid | Returns the GUID associated with the shared parameter definition. | |
| HideWhenNoValue | bool | Indicates whether this parameter should be hidden from the properties palette when it has no value. | |
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. | |
| Name | string | The user visible name for the parameter. | |
| OwnerGroup | DefinitionGroup | Returns or change the group ID of the external parameter definition. | |
| ParameterGroup | BuiltInParameterGroup | Returns the group ID of the parameter definition. | |
| ParameterType | ParameterType | Returns the user visible interpretation of the parameter data. | |
| UserModifiable | bool | Indicates whether the parameter can be modified by the user interface. | |
| Visible | bool | Indicates if the parameter is visible in the Autodesk Revit user interface. | |
| Name | string | The user visible name for the parameter. | Definition |
| ParameterGroup | BuiltInParameterGroup | Returns the group ID of the parameter definition. | Definition |
| ParameterType | ParameterType | Returns the user visible interpretation of the parameter data. | Definition |
| UnitType | UnitType | Returns the UnitType of the parameter definition. | Definition |