Esempio n. 1
0
        public DimensionTypeWrapper(DimensionType dt)
        {
            Name = dt.Name;
            Id   = dt.Id;
            Type = dt.StyleType.ToString();
#if RELEASE2018
            IsUsingProjectUnits = dt.GetUnitsFormatOptions().UseDefault;
#else
            IsUsingProjectUnits = null;
#endif
        }
Esempio n. 2
0
        public DimensionTypeInfo(DimensionType dt)
        {
            Name = dt.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM).AsString();
#if RELEASE2016 || RELEASE2015 || RELEASE2017
// (Konrad) Revit 2016 API doesn't have that info exposed. Also 2017.0 doesn't have it but 2017.1 does.
            UsesProjectUnits = false;
#else
            UsesProjectUnits = dt.GetUnitsFormatOptions().UseDefault;
#endif
            Bold = ElementUtilities.RevitBoolToBool(
                (int)ElementUtilities.GetParameterValue(dt.get_Parameter(BuiltInParameter.TEXT_STYLE_BOLD)));
            Color  = ElementUtilities.RevitColorIntegerToRGBA(dt.get_Parameter(BuiltInParameter.LINE_COLOR).AsInteger());
            Italic = ElementUtilities.RevitBoolToBool(
                (int)ElementUtilities.GetParameterValue(dt.get_Parameter(BuiltInParameter.TEXT_STYLE_ITALIC)));
            LeaderType     = dt.get_Parameter(BuiltInParameter.DIM_LEADER_TYPE).AsValueString();
            LineWeight     = dt.get_Parameter(BuiltInParameter.LINE_PEN).AsInteger();
            TextFont       = dt.get_Parameter(BuiltInParameter.TEXT_FONT).AsString();
            TextSize       = dt.get_Parameter(BuiltInParameter.TEXT_SIZE).AsDouble();
            TextSizeString = dt.get_Parameter(BuiltInParameter.TEXT_SIZE).AsValueString();
            Underline      = ElementUtilities.RevitBoolToBool(
                (int)ElementUtilities.GetParameterValue(dt.get_Parameter(BuiltInParameter.TEXT_STYLE_UNDERLINE)));
            StyleType = dt.StyleType.ToString();
        }