GetDefinition Method


Parameter Element Get Definition Method

Get the definition representing this parameter element.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public InternalDefinition GetDefinition()

Return Value

InternalDefinition
The parameter.
Example
// Check if a given shared parameter in a schedule can vary across groups
public bool CanParamVaryAcrossGroups(ViewSchedule schedule, string sharedParamName)
{
    bool variesAcrossGroups = false;

    int numFields =  schedule.Definition.GetFieldCount();
    // Find the field with the given name
    for (int i = 0; i < numFields; i++)
    {
        ScheduleField field = schedule.Definition.GetField(i);
        if (field.GetName().Contains(sharedParamName))
        {
            // Get the SharedParameterElement from the field's parameter id
            SharedParameterElement spe = schedule.Document.GetElement(field.ParameterId) as SharedParameterElement;
            if (spe != null)
            {
                InternalDefinition definition = spe.GetDefinition();
                variesAcrossGroups = definition.VariesAcrossGroups;
            }
        }
    }

    return variesAcrossGroups;
}
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →