ParameterElement.GetDefinition
Method
Description:
Get the definition representing this parameter element.
Get the definition representing this parameter element.
Examples
// 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;
}