private static void SetConversionUnitsParameters(IModel model, IfcConversionBasedUnit unit, IfcLabel name,
                                                  IfcRatioMeasure ratio, IfcUnitEnum unitType, IfcSIUnitName siUnitName,
                                                  IfcSIPrefix?siUnitPrefix, IfcDimensionalExponents dimensions)
 {
     unit.Name             = name;
     unit.ConversionFactor = model.Instances.New <IfcMeasureWithUnit>();
     unit.ConversionFactor.ValueComponent = ratio;
     unit.ConversionFactor.UnitComponent  = model.Instances.New <IfcSIUnit>(s =>
     {
         s.UnitType = unitType;
         s.Name     = siUnitName;
         s.Prefix   = siUnitPrefix;
     });
     unit.Dimensions = dimensions;
 }
 private static void SetConversionUnitsParameters(IModel model, IfcConversionBasedUnit unit, IfcLabel name,
                                                  IfcRatioMeasure ratio, IfcUnitEnum unitType, IfcSIUnitName siUnitName,
                                                  IfcSIPrefix? siUnitPrefix, IfcDimensionalExponents dimensions)
 {
     unit.Name = name;
     unit.ConversionFactor = model.Instances.New<IfcMeasureWithUnit>();
     unit.ConversionFactor.ValueComponent = ratio;
     unit.ConversionFactor.UnitComponent = model.Instances.New<IfcSIUnit>(s =>
                                                                    {
                                                                        s.UnitType = unitType;
                                                                        s.Name = siUnitName;
                                                                        s.Prefix = siUnitPrefix;
                                                                    });
     unit.Dimensions = dimensions;
 }
Пример #3
0
 /// <summary>
 /// Set the Year Duration Unit
 /// </summary>
 private void SetYearDurationUnit()
 {
     SetSecondUnit();
     
     IfcMeasureWithUnit yearMeasure = Model.Instances.New<IfcMeasureWithUnit>(mwu =>
     {
         mwu.ValueComponent = new IfcReal(3.1536E7);
         mwu.UnitComponent = _secondUnit;
     });
     IfcConversionBasedUnit yearConBaseUnit = Model.Instances.New<IfcConversionBasedUnit>(s =>
     {
         s.UnitType = IfcUnitEnum.TIMEUNIT;
         s.Name = "Year";
         s.Dimensions = _dimensionalExponents;
         s.ConversionFactor = yearMeasure;
     });
     //set context units
     _ifcConversionBasedUnitYear = yearConBaseUnit;
 }
Пример #4
0
        /// <summary>
        /// Set the week duration unit
        /// </summary>
        private void SetMinuteDurationUnit()
        {
            SetSecondUnit();

            IfcMeasureWithUnit minuteMeasure = Model.Instances.New<IfcMeasureWithUnit>(mwu =>
            {
                mwu.ValueComponent = new IfcReal(60); //not accurate week but take average
                mwu.UnitComponent = _secondUnit;
            });
            IfcConversionBasedUnit minuteConBaseUnit = Model.Instances.New<IfcConversionBasedUnit>(s =>
            {
                s.UnitType = IfcUnitEnum.TIMEUNIT;
                s.Name = "Minute";
                s.Dimensions = _dimensionalExponents;
                s.ConversionFactor = minuteMeasure;
            });

            //set context units
            _ifcConversionBasedUnitMinute = minuteConBaseUnit;
        }
Пример #5
0
 public void Reset()
 {
     Contacts.Clear();
     _ifcConversionBasedUnitYear = null;
     _ifcConversionBasedUnitMonth = null;
     _ifcConversionBasedUnitWeek = null;
     _secondUnit = null;
     _dimensionalExponents = null;
     WorkBook = null;
 }