SetParaInt() public static method

set certain parameter of given element to int value
public static SetParaInt ( Element elem, BuiltInParameter paraIndex, int value ) : bool
elem Element given element
paraIndex BuiltInParameter BuiltInParameter
value int
return bool
Beispiel #1
0
        /// <summary>
        /// remove the hooks from one boundary curve of the Major Direction Layer
        /// or Exterior Direction Layer
        /// </summary>
        /// <returns>whether the command is successful</returns>
        private bool ChangeHookType()
        {
            //find two vertical AreaReinforcementCurve
            Line line0 = m_areaReinCurves[0].Curve as Line;
            Line line1 = m_areaReinCurves[1].Curve as Line;
            Line line2 = m_areaReinCurves[2].Curve as Line;
            AreaReinforcementCurve temp = null;

            if (GeomUtil.IsVertical(line0, line1))
            {
                temp = m_areaReinCurves[1];
            }
            else
            {
                temp = m_areaReinCurves[2];
            }

            //remove hooks
            ParameterUtil.SetParaInt(m_areaReinCurves[0],
                                     BuiltInParameter.REBAR_SYSTEM_OVERRIDE, -1);
            Parameter para = m_areaReinCurves[0].get_Parameter(
                BuiltInParameter.REBAR_SYSTEM_HOOK_TYPE_TOP_DIR_1);
            bool flag = ParameterUtil.SetParaNullId(para);

            ParameterUtil.SetParaInt(temp, BuiltInParameter.REBAR_SYSTEM_OVERRIDE, -1);
            para = temp.get_Parameter(
                BuiltInParameter.REBAR_SYSTEM_HOOK_TYPE_TOP_DIR_1);
            flag &= ParameterUtil.SetParaNullId(para);

            return(flag);
        }
Beispiel #2
0
        /// <summary>
        /// turn off all layers but the Major Direction Layer or Exterior Direction Layer
        /// </summary>
        /// <returns>whether the command is successful</returns>
        private bool TurnOffLayers()
        {
            //AreaReinforcement is on the floor or slab
            bool flag = true;

            flag = ParameterUtil.SetParaInt(m_areaRein,
                                            BuiltInParameter.REBAR_SYSTEM_ACTIVE_BOTTOM_DIR_1, 0);
            flag &= ParameterUtil.SetParaInt(m_areaRein,
                                             BuiltInParameter.REBAR_SYSTEM_ACTIVE_BOTTOM_DIR_2, 0);
            flag &= ParameterUtil.SetParaInt(m_areaRein,
                                             BuiltInParameter.REBAR_SYSTEM_ACTIVE_TOP_DIR_2, 0);

            //AreaReinforcement is on the wall
            if (!flag)
            {
                flag  = true;
                flag &= ParameterUtil.SetParaInt(m_areaRein, "Interior Major Direction", 0);
                flag &= ParameterUtil.SetParaInt(m_areaRein, "Exterior Minor Direction", 0);
                flag &= ParameterUtil.SetParaInt(m_areaRein, "Interior Minor Direction", 0);
            }

            return(flag);
        }