Definition.GetDataType
Description:
Gets a ForgeTypeId identifying the data type describing values of the parameter.
Gets a ForgeTypeId identifying the data type describing values of the parameter.
Remarks:
The returned ForgeTypeId may identify either a spec or a category. When it is a category, it indicates a Family Type parameter of that category. See Parameter.IsSpec(ForgeTypeId), UnitUtils.IsMeasurableSpec(ForgeTypeId), Category.IsBuiltInCategory(ForgeTypeId), and Parameter.IsValidDataType(ForgeTypeId).
The returned ForgeTypeId may identify either a spec or a category. When it is a category, it indicates a Family Type parameter of that category. See Parameter.IsSpec(ForgeTypeId), UnitUtils.IsMeasurableSpec(ForgeTypeId), Category.IsBuiltInCategory(ForgeTypeId), and Parameter.IsValidDataType(ForgeTypeId).
public ForgeTypeId GetDataType()
ForgeTypeId
A ForgeTypeId identifying the data type of the parameter.
//Find parameter using the Parameter's definition data type.
public Parameter FindParameter(Element element)
{
Parameter foundParameter = null;
// This will find the first parameter that measures length
foreach (Parameter parameter in element.Parameters)
{
if (parameter.Definition.GetDataType() == SpecTypeId.Length)
{
foundParameter = parameter;
break;
}
}
return foundParameter;
}
No comments yet. Start the discussion.
Loading…