// : this() BbHeaderSetting( string authorName, string authorCompany, string softwareName, string softwareVersion, string softwareCompany, BbUnit bbUnitBase ) { SetCreator(authorName, authorCompany, softwareName, softwareVersion, softwareCompany); SetUnit(bbUnitBase); SetContext(); Setting3D = this; }
BbHeaderSetting( string authorName, string authorCompany, string softwareName, string softwareVersion, string softwareCompany, BbUnit bbUnitBase ) // : this() { SetCreator(authorName, authorCompany, softwareName, softwareVersion, softwareCompany); SetUnit(bbUnitBase); SetContext(); Setting3D = this; }
public void RetrieveUnit(IfcUnitAssignment ifcUnitAssignment) { IfcUnitAssignment = ifcUnitAssignment; _bbUnit = BbUnit.Imperial; foreach (var unit in IfcUnitAssignment.Units) { if (!(unit.Value is IfcSIUnit)) { continue; } var si = unit.Value as IfcSIUnit; if (si.UnitType == IfcUnitEnum.LENGTHUNIT && si.Name == IfcSIUnitName.METRE) { _bbUnit = BbUnit.Metric; } } }
public static BbHeaderSetting Create(string authorName, string authorCompany, string softwareName, string softwareVersion, string softwareCompany, BbUnit bbUnitBase) { var headerSetting = new BbHeaderSetting(authorName, authorCompany, softwareName, softwareVersion, softwareCompany, bbUnitBase); BbInstanceDB.AddToExport(headerSetting); return(headerSetting); }
/// <summary> /// /// </summary> /// <param name="bbUnitBase"></param> public void SetUnit( BbUnit bbUnitBase) { _bbUnit = bbUnitBase; IfcUnitAssignment = new IfcUnitAssignment { Units = new List<IfcUnit>() }; switch (_bbUnit) { case BbUnit.Metric: #region metric IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE) }); IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.AREAUNIT, IfcSIUnitName.SQUARE_METRE) }); IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.VOLUMEUNIT, IfcSIUnitName.CUBIC_METRE) }); #endregion break; case BbUnit.Imperial: #region imperial var leng = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 1, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.LENGTHUNIT, Name = "FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.3048 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.LENGTHUNIT, IfcSIUnitName.METRE) } } }; var length = new IfcUnit { Value = leng }; IfcUnitAssignment.Units.Add(length); var area = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 2, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.AREAUNIT, Name = "SQUARE FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.09290304 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.AREAUNIT, IfcSIUnitName.SQUARE_METRE) } } }; var areaUnit = new IfcUnit { Value = area }; IfcUnitAssignment.Units.Add(areaUnit); var volume = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 3, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.VOLUMEUNIT, Name = "CUBIC FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.02831685 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.VOLUMEUNIT, IfcSIUnitName.CUBIC_METRE) } } }; var volumeUnit = new IfcUnit { Value = volume }; IfcUnitAssignment.Units.Add(volumeUnit); #endregion break; } var degree = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 0, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.PLANEANGLEUNIT, Name = "DEGREE", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcPlaneAngleMeasure { Value = 0.01745329 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.PLANEANGLEUNIT, IfcSIUnitName.RADIAN) } } }; var angle = new IfcUnit { Value = degree }; IfcUnitAssignment.Units.Add(angle); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.SOLIDANGLEUNIT, IfcSIUnitName.STERADIAN) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.MASSUNIT, IfcSIUnitName.GRAM) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.TIMEUNIT, IfcSIUnitName.SECOND) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT, IfcSIUnitName.DEGREE_CELSIUS) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.LUMINOUSINTENSITYUNIT, IfcSIUnitName.LUMEN) }); }
public void RetrieveUnit(IfcUnitAssignment ifcUnitAssignment) { IfcUnitAssignment = ifcUnitAssignment; _bbUnit = BbUnit.Imperial; foreach (var unit in IfcUnitAssignment.Units) { if (!(unit.Value is IfcSIUnit)) continue; var si = unit.Value as IfcSIUnit; if (si.UnitType == IfcUnitEnum.LENGTHUNIT && si.Name == IfcSIUnitName.METRE) _bbUnit = BbUnit.Metric; } }
public static BbHeaderSetting Create(string authorName, string authorCompany, string softwareName, string softwareVersion, string softwareCompany, BbUnit bbUnitBase) { var headerSetting = new BbHeaderSetting(authorName, authorCompany, softwareName, softwareVersion, softwareCompany, bbUnitBase); BbInstanceDB.AddToExport(headerSetting); return headerSetting; }
/// <summary> /// /// </summary> /// <param name="bbUnitBase"></param> public void SetUnit( BbUnit bbUnitBase) { _bbUnit = bbUnitBase; IfcUnitAssignment = new IfcUnitAssignment { Units = new List <IfcUnit>() }; switch (_bbUnit) { case BbUnit.Metric: #region metric IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE) }); IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.AREAUNIT, IfcSIUnitName.SQUARE_METRE) }); IfcUnitAssignment.Units.Add( new IfcUnit { Value = new IfcSIUnit( IfcUnitEnum.VOLUMEUNIT, IfcSIUnitName.CUBIC_METRE) }); #endregion break; case BbUnit.Imperial: #region imperial var leng = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 1, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.LENGTHUNIT, Name = "FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.3048 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.LENGTHUNIT, IfcSIUnitName.METRE) } } }; var length = new IfcUnit { Value = leng }; IfcUnitAssignment.Units.Add(length); var area = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 2, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.AREAUNIT, Name = "SQUARE FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.09290304 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.AREAUNIT, IfcSIUnitName.SQUARE_METRE) } } }; var areaUnit = new IfcUnit { Value = area }; IfcUnitAssignment.Units.Add(areaUnit); var volume = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 3, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.VOLUMEUNIT, Name = "CUBIC FOOT", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcRatioMeasure { Value = 0.02831685 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.VOLUMEUNIT, IfcSIUnitName.CUBIC_METRE) } } }; var volumeUnit = new IfcUnit { Value = volume }; IfcUnitAssignment.Units.Add(volumeUnit); #endregion break; } var degree = new IfcConversionBasedUnit { Dimensions = new IfcDimensionalExponents { LengthExponent = 0, MassExponent = 0, TimeExponent = 0, ElectricCurrentExponent = 0, ThermodynamicTemperatureExponent = 0, AmountOfSubstanceExponent = 0, LuminousIntensityExponent = 0, }, UnitType = IfcUnitEnum.PLANEANGLEUNIT, Name = "DEGREE", ConversionFactor = new IfcMeasureWithUnit { ValueComponent = new IfcValue { Value = new IfcPlaneAngleMeasure { Value = 0.01745329 } }, UnitComponent = new IfcUnit { Value = new IfcSIUnit(IfcUnitEnum.PLANEANGLEUNIT, IfcSIUnitName.RADIAN) } } }; var angle = new IfcUnit { Value = degree }; IfcUnitAssignment.Units.Add(angle); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.SOLIDANGLEUNIT, IfcSIUnitName.STERADIAN) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.MASSUNIT, IfcSIUnitName.GRAM) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.TIMEUNIT, IfcSIUnitName.SECOND) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT, IfcSIUnitName.DEGREE_CELSIUS) }); IfcUnitAssignment.Units.Add( new IfcUnit() { Value = new IfcSIUnit(IfcUnitEnum.LUMINOUSINTENSITYUNIT, IfcSIUnitName.LUMEN) }); }