Ejemplo n.º 1
0
        /// <summary>
        /// Calculates the start hook angle for a rebar subelement, from the subelement cache. This is used for Free Form Rebar when the Workshop intructions are Bent.
        /// <param name="element">
        /// The element to calculate the value.
        /// </param>
        /// <param name="handle">
        /// The IFC handle that may offer parameter overrides.
        /// </param>
        /// <returns>
        /// True if the operation succeed, false otherwise.
        /// </returns>
        public override bool GetParameterFromSubelementCache(Element element, IFCAnyHandle handle)
        {
            Parameter param = element.get_Parameter(BuiltInParameter.REBAR_ELEM_HOOK_START_TYPE);

            if (param == null)
            {
                return(false);
            }

            if (param.Definition == null)
            {
                return(false);
            }

            ElementIdParameterValue paramVal = ParameterUtil.getParameterValueByNameFromSubelementCache(element.Id, handle, param.Definition.Name) as ElementIdParameterValue;

            if (paramVal != null)
            {
                RebarHookType hookType = element.Document.GetElement(paramVal.Value) as RebarHookType;
                if (hookType == null)
                {
                    return(false);
                }

                m_Angle = UnitUtil.ScaleAngle(hookType.HookAngle);

                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Calculates the shape code for a rebar subelement, from the subelement cache. This is used for Free Form Rebar when the Workshop intructions are Bent.
        /// <param name="element">
        /// The element to calculate the value.
        /// </param>
        /// <param name="handle">
        /// The IFC handle that may offer parameter overrides.
        /// </param>
        /// <returns>
        /// True if the operation succeed, false otherwise.
        /// </returns>
        public override bool GetParameterFromSubelementCache(Element element, IFCAnyHandle handle)
        {
            Parameter param = element.get_Parameter(BuiltInParameter.REBAR_SHAPE);

            if (param == null)
            {
                return(false);
            }

            if (param.Definition == null)
            {
                return(false);
            }

            ElementIdParameterValue paramVal = ParameterUtil.getParameterValueByNameFromSubelementCache(element.Id, handle, param.Definition.Name) as ElementIdParameterValue;

            if (paramVal != null)
            {
                Element rebarShape = element.Document.GetElement(paramVal.Value);
                if (rebarShape == null)
                {
                    return(false);
                }

                m_ShapeCode = rebarShape.Name;

                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Retrieves shape parameter A for a rebar subelement, from the subelement cache.
        /// </summary>
        /// <param name="element">
        /// The element to calculate the value.
        /// </param>
        /// <param name="handle">
        /// The IFC handle that may offer parameter overrides.
        /// </param>
        /// <returns>
        /// True if the operation succeed, false otherwise.
        /// </returns>
        public override bool GetParameterFromSubelementCache(Element element, IFCAnyHandle handle)
        {
            DoubleParameterValue paramVal = ParameterUtil.getParameterValueByNameFromSubelementCache(element.Id, handle, "A") as DoubleParameterValue;

            if (paramVal != null)
            {
                m_ShapeParameterA = UnitUtil.ScaleLength(paramVal.Value);
                return(true);
            }
            return(false);
        }