コード例 #1
0
 public TextNoteTypeInfo(Element tnt)
 {
     Name = tnt.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM).AsString();
     Bold = ElementUtilities.RevitBoolToBool(
         (int)ElementUtilities.GetParameterValue(tnt.get_Parameter(BuiltInParameter.TEXT_STYLE_BOLD)));
     Color  = ElementUtilities.RevitColorIntegerToRGBA(tnt.get_Parameter(BuiltInParameter.LINE_COLOR).AsInteger());
     Italic = ElementUtilities.RevitBoolToBool(
         (int)ElementUtilities.GetParameterValue(tnt.get_Parameter(BuiltInParameter.TEXT_STYLE_ITALIC)));
     LeaderArrowhead = tnt.get_Parameter(BuiltInParameter.LEADER_ARROWHEAD).AsValueString();
     LineWeight      = tnt.get_Parameter(BuiltInParameter.LINE_PEN).AsInteger();
     TextFont        = tnt.get_Parameter(BuiltInParameter.TEXT_FONT).AsString();
     TextSize        = tnt.get_Parameter(BuiltInParameter.TEXT_SIZE).AsDouble();
     TextSizeString  = tnt.get_Parameter(BuiltInParameter.TEXT_SIZE).AsValueString();
     Underline       = ElementUtilities.RevitBoolToBool(
         (int)ElementUtilities.GetParameterValue(tnt.get_Parameter(BuiltInParameter.TEXT_STYLE_UNDERLINE)));
 }
コード例 #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();
        }