public static DataConcept ToDataConcept(this IIfcValue v, DataOp dataOp = DataOp.Equals) { if (v.UnderlyingSystemType.IsPrimitive) { if (v.UnderlyingSystemType == typeof(double) || v.UnderlyingSystemType == typeof(float)) { return new DataConcept { Op = dataOp, Digit = (double)v.Value, Type = DataType.Decimal } } ; else if (v.UnderlyingSystemType == typeof(long) || v.UnderlyingSystemType == typeof(int)) { return new DataConcept { Op = dataOp, Digit = (double)v.Value, Type = DataType.Integer } } ; else if (v.UnderlyingSystemType == typeof(string)) { return new DataConcept { Op = dataOp, Serialized = v.Value?.ToString(), Type = DataType.String } } ; } throw new NotImplementedException($"Missing implementation for '{v.GetType().Name}'"); } }
public static string getDefaultIfcUnitStr(IIfcValue value) { // Initialize the static Dicts, if it is still empty upon the first use. These Dicts do not need to be reset setupUnitRep(); if (value != null) { return(getDefaultIfcUnitStr(value.GetType())); } else { return(null); } }
public static IfcValue ToIfc3(this IIfcValue member) { if (member == null) { return(null); } var name = member.GetType().Name; switch (name) { case "IfcAbsorbedDoseMeasure": return(new IfcAbsorbedDoseMeasure((MeasureResource.IfcAbsorbedDoseMeasure)member)); case "IfcAccelerationMeasure": return(new IfcAccelerationMeasure((MeasureResource.IfcAccelerationMeasure)member)); case "IfcAngularVelocityMeasure": return(new IfcAngularVelocityMeasure((MeasureResource.IfcAngularVelocityMeasure)member)); case "IfcAreaDensityMeasure": return(null); case "IfcCompoundPlaneAngleMeasure": return(new IfcCompoundPlaneAngleMeasure((MeasureResource.IfcCompoundPlaneAngleMeasure)member)); case "IfcCurvatureMeasure": return(new IfcCurvatureMeasure((MeasureResource.IfcCurvatureMeasure)member)); case "IfcDoseEquivalentMeasure": return(new IfcDoseEquivalentMeasure((MeasureResource.IfcDoseEquivalentMeasure)member)); case "IfcDynamicViscosityMeasure": return(new IfcDynamicViscosityMeasure((MeasureResource.IfcDynamicViscosityMeasure)member)); case "IfcElectricCapacitanceMeasure": return(new IfcElectricCapacitanceMeasure((MeasureResource.IfcElectricCapacitanceMeasure)member)); case "IfcElectricChargeMeasure": return(new IfcElectricChargeMeasure((MeasureResource.IfcElectricChargeMeasure)member)); case "IfcElectricConductanceMeasure": return(new IfcElectricConductanceMeasure((MeasureResource.IfcElectricConductanceMeasure)member)); case "IfcElectricResistanceMeasure": return(new IfcElectricResistanceMeasure((MeasureResource.IfcElectricResistanceMeasure)member)); case "IfcElectricVoltageMeasure": return(new IfcElectricVoltageMeasure((MeasureResource.IfcElectricVoltageMeasure)member)); case "IfcEnergyMeasure": return(new IfcEnergyMeasure((MeasureResource.IfcEnergyMeasure)member)); case "IfcForceMeasure": return(new IfcForceMeasure((MeasureResource.IfcForceMeasure)member)); case "IfcFrequencyMeasure": return(new IfcFrequencyMeasure((MeasureResource.IfcFrequencyMeasure)member)); case "IfcHeatFluxDensityMeasure": return(new IfcHeatFluxDensityMeasure((MeasureResource.IfcHeatFluxDensityMeasure)member)); case "IfcHeatingValueMeasure": return(new IfcHeatingValueMeasure((MeasureResource.IfcHeatingValueMeasure)member)); case "IfcIlluminanceMeasure": return(new IfcIlluminanceMeasure((MeasureResource.IfcIlluminanceMeasure)member)); case "IfcInductanceMeasure": return(new IfcInductanceMeasure((MeasureResource.IfcInductanceMeasure)member)); case "IfcIntegerCountRateMeasure": return(new IfcIntegerCountRateMeasure((MeasureResource.IfcIntegerCountRateMeasure)member)); case "IfcIonConcentrationMeasure": return(new IfcIonConcentrationMeasure((MeasureResource.IfcIonConcentrationMeasure)member)); case "IfcIsothermalMoistureCapacityMeasure": return(new IfcIsothermalMoistureCapacityMeasure((MeasureResource.IfcIsothermalMoistureCapacityMeasure)member)); case "IfcKinematicViscosityMeasure": return(new IfcKinematicViscosityMeasure((MeasureResource.IfcKinematicViscosityMeasure)member)); case "IfcLinearForceMeasure": return(new IfcLinearForceMeasure((MeasureResource.IfcLinearForceMeasure)member)); case "IfcLinearMomentMeasure": return(new IfcLinearMomentMeasure((MeasureResource.IfcLinearMomentMeasure)member)); case "IfcLinearStiffnessMeasure": return(new IfcLinearStiffnessMeasure((MeasureResource.IfcLinearStiffnessMeasure)member)); case "IfcLinearVelocityMeasure": return(new IfcLinearVelocityMeasure((MeasureResource.IfcLinearVelocityMeasure)member)); case "IfcLuminousFluxMeasure": return(new IfcLuminousFluxMeasure((MeasureResource.IfcLuminousFluxMeasure)member)); case "IfcLuminousIntensityDistributionMeasure": return(new IfcLuminousIntensityDistributionMeasure((MeasureResource.IfcLuminousIntensityDistributionMeasure)member)); case "IfcMagneticFluxDensityMeasure": return(new IfcMagneticFluxDensityMeasure((MeasureResource.IfcMagneticFluxDensityMeasure)member)); case "IfcMagneticFluxMeasure": return(new IfcMagneticFluxMeasure((MeasureResource.IfcMagneticFluxMeasure)member)); case "IfcMassDensityMeasure": return(new IfcMassDensityMeasure((MeasureResource.IfcMassDensityMeasure)member)); case "IfcMassFlowRateMeasure": return(new IfcMassFlowRateMeasure((MeasureResource.IfcMassFlowRateMeasure)member)); case "IfcMassPerLengthMeasure": return(new IfcMassPerLengthMeasure((MeasureResource.IfcMassPerLengthMeasure)member)); case "IfcModulusOfElasticityMeasure": return(new IfcModulusOfElasticityMeasure((MeasureResource.IfcModulusOfElasticityMeasure)member)); case "IfcModulusOfLinearSubgradeReactionMeasure": return(new IfcModulusOfLinearSubgradeReactionMeasure((MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure)member)); case "IfcModulusOfRotationalSubgradeReactionMeasure": return(new IfcModulusOfRotationalSubgradeReactionMeasure((MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure)member)); case "IfcModulusOfSubgradeReactionMeasure": return(new IfcModulusOfSubgradeReactionMeasure((MeasureResource.IfcModulusOfSubgradeReactionMeasure)member)); case "IfcMoistureDiffusivityMeasure": return(new IfcMoistureDiffusivityMeasure((MeasureResource.IfcMoistureDiffusivityMeasure)member)); case "IfcMolecularWeightMeasure": return(new IfcMolecularWeightMeasure((MeasureResource.IfcMolecularWeightMeasure)member)); case "IfcMomentOfInertiaMeasure": return(new IfcMomentOfInertiaMeasure((MeasureResource.IfcMomentOfInertiaMeasure)member)); case "IfcMonetaryMeasure": return(new IfcMonetaryMeasure((MeasureResource.IfcMonetaryMeasure)member)); case "IfcPHMeasure": return(new IfcPHMeasure((MeasureResource.IfcPHMeasure)member)); case "IfcPlanarForceMeasure": return(new IfcPlanarForceMeasure((MeasureResource.IfcPlanarForceMeasure)member)); case "IfcPowerMeasure": return(new IfcPowerMeasure((MeasureResource.IfcPowerMeasure)member)); case "IfcPressureMeasure": return(new IfcPressureMeasure((MeasureResource.IfcPressureMeasure)member)); case "IfcRadioActivityMeasure": return(new IfcRadioActivityMeasure((MeasureResource.IfcRadioActivityMeasure)member)); case "IfcRotationalFrequencyMeasure": return(new IfcRotationalFrequencyMeasure((MeasureResource.IfcRotationalFrequencyMeasure)member)); case "IfcRotationalMassMeasure": return(new IfcRotationalMassMeasure((MeasureResource.IfcRotationalMassMeasure)member)); case "IfcRotationalStiffnessMeasure": return(new IfcRotationalStiffnessMeasure((MeasureResource.IfcRotationalStiffnessMeasure)member)); case "IfcSectionModulusMeasure": return(new IfcSectionModulusMeasure((MeasureResource.IfcSectionModulusMeasure)member)); case "IfcSectionalAreaIntegralMeasure": return(new IfcSectionalAreaIntegralMeasure((MeasureResource.IfcSectionalAreaIntegralMeasure)member)); case "IfcShearModulusMeasure": return(new IfcShearModulusMeasure((MeasureResource.IfcShearModulusMeasure)member)); case "IfcSoundPowerLevelMeasure": return(new IfcSoundPowerMeasure((IfcSoundPowerLevelMeasure)member)); case "IfcSoundPowerMeasure": return(new IfcSoundPowerMeasure((MeasureResource.IfcSoundPowerMeasure)member)); case "IfcSoundPressureLevelMeasure": return(new IfcSoundPressureMeasure((IfcSoundPressureLevelMeasure)member)); case "IfcSoundPressureMeasure": return(new IfcSoundPressureMeasure((MeasureResource.IfcSoundPressureMeasure)member)); case "IfcSpecificHeatCapacityMeasure": return(new IfcSpecificHeatCapacityMeasure((MeasureResource.IfcSpecificHeatCapacityMeasure)member)); case "IfcTemperatureGradientMeasure": return(new IfcTemperatureGradientMeasure((MeasureResource.IfcTemperatureGradientMeasure)member)); case "IfcTemperatureRateOfChangeMeasure": return(null); case "IfcThermalAdmittanceMeasure": return(new IfcThermalAdmittanceMeasure((MeasureResource.IfcThermalAdmittanceMeasure)member)); case "IfcThermalConductivityMeasure": return(new IfcThermalConductivityMeasure((MeasureResource.IfcThermalConductivityMeasure)member)); case "IfcThermalExpansionCoefficientMeasure": return(new IfcThermalExpansionCoefficientMeasure((MeasureResource.IfcThermalExpansionCoefficientMeasure)member)); case "IfcThermalResistanceMeasure": return(new IfcThermalResistanceMeasure((MeasureResource.IfcThermalResistanceMeasure)member)); case "IfcThermalTransmittanceMeasure": return(new IfcThermalTransmittanceMeasure((MeasureResource.IfcThermalTransmittanceMeasure)member)); case "IfcTorqueMeasure": return(new IfcTorqueMeasure((MeasureResource.IfcTorqueMeasure)member)); case "IfcVaporPermeabilityMeasure": return(new IfcVaporPermeabilityMeasure((MeasureResource.IfcVaporPermeabilityMeasure)member)); case "IfcVolumetricFlowRateMeasure": return(new IfcVolumetricFlowRateMeasure((MeasureResource.IfcVolumetricFlowRateMeasure)member)); case "IfcWarpingConstantMeasure": return(new IfcWarpingConstantMeasure((MeasureResource.IfcWarpingConstantMeasure)member)); case "IfcWarpingMomentMeasure": return(new IfcWarpingMomentMeasure((MeasureResource.IfcWarpingMomentMeasure)member)); case "IfcAmountOfSubstanceMeasure": return(new IfcAmountOfSubstanceMeasure((MeasureResource.IfcAmountOfSubstanceMeasure)member)); case "IfcAreaMeasure": return(new IfcAreaMeasure((MeasureResource.IfcAreaMeasure)member)); case "IfcComplexNumber": return(new IfcComplexNumber((MeasureResource.IfcComplexNumber)member)); case "IfcContextDependentMeasure": return(new IfcContextDependentMeasure((MeasureResource.IfcContextDependentMeasure)member)); case "IfcCountMeasure": return(new IfcCountMeasure((MeasureResource.IfcCountMeasure)member)); case "IfcDescriptiveMeasure": return(new IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)member)); case "IfcElectricCurrentMeasure": return(new IfcElectricCurrentMeasure((MeasureResource.IfcElectricCurrentMeasure)member)); case "IfcLengthMeasure": return(new IfcLengthMeasure((MeasureResource.IfcLengthMeasure)member)); case "IfcLuminousIntensityMeasure": return(new IfcLuminousIntensityMeasure((MeasureResource.IfcLuminousIntensityMeasure)member)); case "IfcMassMeasure": return(new IfcMassMeasure((MeasureResource.IfcMassMeasure)member)); case "IfcNonNegativeLengthMeasure": return(null); case "IfcNormalisedRatioMeasure": return(new IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)member)); case "IfcNumericMeasure": return(new IfcNumericMeasure((MeasureResource.IfcNumericMeasure)member)); case "IfcParameterValue": return(new IfcParameterValue((MeasureResource.IfcParameterValue)member)); case "IfcPlaneAngleMeasure": return(new IfcPlaneAngleMeasure((MeasureResource.IfcPlaneAngleMeasure)member)); case "IfcPositiveLengthMeasure": return(new IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)member)); case "IfcPositivePlaneAngleMeasure": return(new IfcPositivePlaneAngleMeasure((MeasureResource.IfcPositivePlaneAngleMeasure)member)); case "IfcPositiveRatioMeasure": return(new IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)member)); case "IfcRatioMeasure": return(new IfcRatioMeasure((MeasureResource.IfcRatioMeasure)member)); case "IfcSolidAngleMeasure": return(new IfcSolidAngleMeasure((MeasureResource.IfcSolidAngleMeasure)member)); case "IfcThermodynamicTemperatureMeasure": return(new IfcThermodynamicTemperatureMeasure((MeasureResource.IfcThermodynamicTemperatureMeasure)member)); case "IfcTimeMeasure": return(new IfcTimeMeasure((MeasureResource.IfcTimeMeasure)member)); case "IfcVolumeMeasure": return(new IfcVolumeMeasure((MeasureResource.IfcVolumeMeasure)member)); case "IfcBoolean": return(new IfcBoolean((MeasureResource.IfcBoolean)member)); case "IfcDate": return(null); case "IfcDateTime": return(null); case "IfcDuration": return(null); case "IfcIdentifier": return(new IfcIdentifier((MeasureResource.IfcIdentifier)member)); case "IfcInteger": return(new IfcInteger((MeasureResource.IfcInteger)member)); case "IfcLabel": return(new IfcLabel((MeasureResource.IfcLabel)member)); case "IfcLogical": return(new IfcLogical((MeasureResource.IfcLogical)member)); case "IfcPositiveInteger": return(null); case "IfcReal": return(new IfcReal((MeasureResource.IfcReal)member)); case "IfcText": return(new IfcText((MeasureResource.IfcText)member)); case "IfcTime": return(null); case "IfcTimeStamp": return(new IfcTimeStamp((DateTimeResource.IfcTimeStamp)member)); default: throw new NotSupportedException(); } }