2020 Method
Changes 0
M

RebarShapeDefinition.AddFormulaParameter

Description:
Add a formula-driven parameter to the shape definition.
Remarks:
Like AddParameter(), this function introduces a parameter into the shape definition, but the parameter's value is driven by a formula. Formula parameters cannot be used in constraints to drive the shape. The formula is in the same format as in Revit families. The formula is allowed to refer to other parameters that are already in the definition, plus the builtin parameters REBAR_INSTANCE_BAR_DIAMETER, REBAR_INSTANCE_BEND_DIAMETER, REBAR_SHAPE_START_HOOK_LENGTH, REBAR_SHAPE_START_HOOK_OFFSET, REBAR_SHAPE_PARAM_START_HOOK_TAN_LEN, REBAR_SHAPE_PARAM_END_HOOK_TAN_LEN, REBAR_SHAPE_END_HOOK_LENGTH, REBAR_SHAPE_END_HOOK_OFFSET, REBAR_ELEM_LENGTH, REBAR_ELEM_TOTAL_LENGTH, and REBAR_ELEM_QUANTITY_OF_BARS.
public void AddFormulaParameter(
	ElementId paramId,
	string formula
)
  • paramId
    The parameter. To obtain the id of a shared parameter, call RebarShapeParameters.GetElementIdForExternalDefinition.
  • formula
    The formula expressed as a string. The string is exactly what a user would type into the Family Types dialog, e.g. "Total Length*3.14159*(Bar Diameter/2)*(Bar Diameter/2)"