Пример #1
0
        public override double GetDimension <T>(T plate, DimensionKind kind)
        {
            BuiltInParameter  param      = Plate.GetParameterByKind(kind);
            SteelProxyElement plateFree  = plate as SteelProxyElement;
            Parameter         plateParam = plateFree.get_Parameter(param);

            if (plateParam == null || !plateParam.HasValue)
            {
                throw new Exception("Нет параметра " + Enum.GetName(typeof(DimensionKind), kind) + " в пластине " + plateFree.Id.IntegerValue.ToString());
            }
            double dim = plateParam.AsDouble();

            return(dim);
        }
Пример #2
0
        public override double GetDimension <T>(T plate, DimensionKind kind)
        {
            BuiltInParameter param            = Plate.GetParameterByKind(kind);
            Subelement       plateAsSubelem   = plate as Subelement;
            ParameterValue   lengthParamValue = plateAsSubelem.GetParameterValue(new ElementId(param));

            if (lengthParamValue == null)
            {
                throw new Exception("Нет параметра " + Enum.GetName(typeof(DimensionKind), kind) + " в пластине " + plateAsSubelem.Element.Id.IntegerValue.ToString());
            }
            DoubleParameterValue lengthDoubleValue = lengthParamValue as DoubleParameterValue;

            return(lengthDoubleValue.Value);
        }