예제 #1
0
 /// <summary>
 /// set the project unit Decimal Symbol And Grouping.
 /// </summary>
 public void SetDecimalSymbolAndGrouping(Autodesk.Revit.DB.DecimalSymbol decimalSymbol, Autodesk.Revit.DB.DigitGroupingSymbol digitGroupingSymbol, Autodesk.Revit.DB.DigitGroupingAmount digitGroupingAmount)
 {
     m_units.SetDecimalSymbolAndGrouping(decimalSymbol, digitGroupingSymbol, digitGroupingAmount);
     m_decimalSymbol       = decimalSymbol;
     m_digitGroupingSymbol = digitGroupingSymbol;
     m_digitGroupingAmount = digitGroupingAmount;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of ProjectUnitData
 /// </summary>
 /// <param name="units">an object of Autodesk.Revit.DB.Units</param>
 public ProjectUnitData(Autodesk.Revit.DB.Units units)
 {
     m_unitType_formatOptions.Clear();
     m_units = units;
     foreach (Autodesk.Revit.DB.UnitType unittype in Enum.GetValues(typeof(
                                                                        Autodesk.Revit.DB.UnitType)))
     {
         try
         {
             Autodesk.Revit.DB.FormatOptions formatOptions = m_units.GetFormatOptions(unittype);
             m_unitType_formatOptions.Add(unittype, formatOptions);
             m_unitType_label.Add(unittype, Autodesk.Revit.DB.LabelUtils.GetLabelFor(unittype));
         }
         catch
         {
             continue;
         }
     }
     m_decimalSymbol       = units.DecimalSymbol;
     m_digitGroupingSymbol = units.DigitGroupingSymbol;
     m_digitGroupingAmount = units.DigitGroupingAmount;
     foreach (Autodesk.Revit.DB.DisplayUnitType displayunittype in Enum.GetValues(typeof(
                                                                                      Autodesk.Revit.DB.DisplayUnitType)))
     {
         try
         {
             m_displayUnitType_label.Add(displayunittype, Autodesk.Revit.DB.LabelUtils.GetLabelFor(displayunittype));
         }
         catch
         {
             continue;
         }
     }
     foreach (Autodesk.Revit.DB.UnitSymbolType unitsymboltype in Enum.GetValues(typeof(
                                                                                    Autodesk.Revit.DB.UnitSymbolType)))
     {
         try
         {
             m_unitSymbolType_label.Add(unitsymboltype, Autodesk.Revit.DB.LabelUtils.GetLabelFor(unitsymboltype));
         }
         catch
         {
             if (unitsymboltype == Autodesk.Revit.DB.UnitSymbolType.UST_NONE)
             {
                 m_unitSymbolType_label.Add(unitsymboltype, "(NONE)");
             }
             continue;
         }
     }
 }