// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool Xbim.CodeGeneration 
//  
//     Changes to this file may cause incorrect behaviour and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

using Xbim.Ifc4.Interfaces;
using System.Collections.Generic;
using System.Linq;
using Xbim.Common;

//## Custom using statements
//##

// ReSharper disable once CheckNamespace
namespace Xbim.Ifc4x3.ConstraintResource
{
	public partial class @IfcMetric : IIfcMetric
	{

		[CrossSchemaAttribute(typeof(IIfcMetric), 8)]
		Ifc4.Interfaces.IfcBenchmarkEnum IIfcMetric.Benchmark 
		{ 
			get
			{
				//## Custom code to handle enumeration of Benchmark
				//##
				switch (Benchmark)
				{
					case IfcBenchmarkEnum.EQUALTO:
						return Ifc4.Interfaces.IfcBenchmarkEnum.EQUALTO;
					case IfcBenchmarkEnum.GREATERTHAN:
						return Ifc4.Interfaces.IfcBenchmarkEnum.GREATERTHAN;
					case IfcBenchmarkEnum.GREATERTHANOREQUALTO:
						return Ifc4.Interfaces.IfcBenchmarkEnum.GREATERTHANOREQUALTO;
					case IfcBenchmarkEnum.INCLUDEDIN:
						return Ifc4.Interfaces.IfcBenchmarkEnum.INCLUDEDIN;
					case IfcBenchmarkEnum.INCLUDES:
						return Ifc4.Interfaces.IfcBenchmarkEnum.INCLUDES;
					case IfcBenchmarkEnum.LESSTHAN:
						return Ifc4.Interfaces.IfcBenchmarkEnum.LESSTHAN;
					case IfcBenchmarkEnum.LESSTHANOREQUALTO:
						return Ifc4.Interfaces.IfcBenchmarkEnum.LESSTHANOREQUALTO;
					case IfcBenchmarkEnum.NOTEQUALTO:
						return Ifc4.Interfaces.IfcBenchmarkEnum.NOTEQUALTO;
					case IfcBenchmarkEnum.NOTINCLUDEDIN:
						return Ifc4.Interfaces.IfcBenchmarkEnum.NOTINCLUDEDIN;
					case IfcBenchmarkEnum.NOTINCLUDES:
						return Ifc4.Interfaces.IfcBenchmarkEnum.NOTINCLUDES;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of Benchmark
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcBenchmarkEnum.GREATERTHAN:
						Benchmark = IfcBenchmarkEnum.GREATERTHAN;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.GREATERTHANOREQUALTO:
						Benchmark = IfcBenchmarkEnum.GREATERTHANOREQUALTO;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.LESSTHAN:
						Benchmark = IfcBenchmarkEnum.LESSTHAN;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.LESSTHANOREQUALTO:
						Benchmark = IfcBenchmarkEnum.LESSTHANOREQUALTO;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.EQUALTO:
						Benchmark = IfcBenchmarkEnum.EQUALTO;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.NOTEQUALTO:
						Benchmark = IfcBenchmarkEnum.NOTEQUALTO;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.INCLUDES:
						Benchmark = IfcBenchmarkEnum.INCLUDES;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.NOTINCLUDES:
						Benchmark = IfcBenchmarkEnum.NOTINCLUDES;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.INCLUDEDIN:
						Benchmark = IfcBenchmarkEnum.INCLUDEDIN;
						return;
					case Ifc4.Interfaces.IfcBenchmarkEnum.NOTINCLUDEDIN:
						Benchmark = IfcBenchmarkEnum.NOTINCLUDEDIN;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMetric), 9)]
		Ifc4.MeasureResource.IfcLabel? IIfcMetric.ValueSource 
		{ 
			get
			{
				if (!ValueSource.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(ValueSource.Value);
			} 
			set
			{
				ValueSource = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		private  IIfcMetricValueSelect _dataValue4;


		[CrossSchemaAttribute(typeof(IIfcMetric), 10)]
		IIfcMetricValueSelect IIfcMetric.DataValue 
		{ 
			get
			{
				if (_dataValue4 != null) return _dataValue4;
				if (DataValue == null) return null;
				var ifcappliedvalue = DataValue as CostResource.IfcAppliedValue;
				if (ifcappliedvalue != null) 
					return ifcappliedvalue;
				var ifcmeasurewithunit = DataValue as MeasureResource.IfcMeasureWithUnit;
				if (ifcmeasurewithunit != null) 
					return ifcmeasurewithunit;
				var ifcreference = DataValue as IfcReference;
				if (ifcreference != null) 
					return ifcreference;
				var ifctable = DataValue as UtilityResource.IfcTable;
				if (ifctable != null) 
					return ifctable;
				var ifctimeseries = DataValue as DateTimeResource.IfcTimeSeries;
				if (ifctimeseries != null) 
					return ifctimeseries;
				if (DataValue is MeasureResource.IfcAbsorbedDoseMeasure) 
					return new Ifc4.MeasureResource.IfcAbsorbedDoseMeasure((MeasureResource.IfcAbsorbedDoseMeasure)DataValue);
				if (DataValue is MeasureResource.IfcAccelerationMeasure) 
					return new Ifc4.MeasureResource.IfcAccelerationMeasure((MeasureResource.IfcAccelerationMeasure)DataValue);
				if (DataValue is MeasureResource.IfcAngularVelocityMeasure) 
					return new Ifc4.MeasureResource.IfcAngularVelocityMeasure((MeasureResource.IfcAngularVelocityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcAreaDensityMeasure) 
					return new Ifc4.MeasureResource.IfcAreaDensityMeasure((MeasureResource.IfcAreaDensityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcCompoundPlaneAngleMeasure) 
					return new Ifc4.MeasureResource.IfcCompoundPlaneAngleMeasure((MeasureResource.IfcCompoundPlaneAngleMeasure)DataValue);
				if (DataValue is MeasureResource.IfcCurvatureMeasure) 
					return new Ifc4.MeasureResource.IfcCurvatureMeasure((MeasureResource.IfcCurvatureMeasure)DataValue);
				if (DataValue is MeasureResource.IfcDoseEquivalentMeasure) 
					return new Ifc4.MeasureResource.IfcDoseEquivalentMeasure((MeasureResource.IfcDoseEquivalentMeasure)DataValue);
				if (DataValue is MeasureResource.IfcDynamicViscosityMeasure) 
					return new Ifc4.MeasureResource.IfcDynamicViscosityMeasure((MeasureResource.IfcDynamicViscosityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricCapacitanceMeasure) 
					return new Ifc4.MeasureResource.IfcElectricCapacitanceMeasure((MeasureResource.IfcElectricCapacitanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricChargeMeasure) 
					return new Ifc4.MeasureResource.IfcElectricChargeMeasure((MeasureResource.IfcElectricChargeMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricConductanceMeasure) 
					return new Ifc4.MeasureResource.IfcElectricConductanceMeasure((MeasureResource.IfcElectricConductanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricResistanceMeasure) 
					return new Ifc4.MeasureResource.IfcElectricResistanceMeasure((MeasureResource.IfcElectricResistanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricVoltageMeasure) 
					return new Ifc4.MeasureResource.IfcElectricVoltageMeasure((MeasureResource.IfcElectricVoltageMeasure)DataValue);
				if (DataValue is MeasureResource.IfcEnergyMeasure) 
					return new Ifc4.MeasureResource.IfcEnergyMeasure((MeasureResource.IfcEnergyMeasure)DataValue);
				if (DataValue is MeasureResource.IfcForceMeasure) 
					return new Ifc4.MeasureResource.IfcForceMeasure((MeasureResource.IfcForceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcFrequencyMeasure) 
					return new Ifc4.MeasureResource.IfcFrequencyMeasure((MeasureResource.IfcFrequencyMeasure)DataValue);
				if (DataValue is MeasureResource.IfcHeatFluxDensityMeasure) 
					return new Ifc4.MeasureResource.IfcHeatFluxDensityMeasure((MeasureResource.IfcHeatFluxDensityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcHeatingValueMeasure) 
					return new Ifc4.MeasureResource.IfcHeatingValueMeasure((MeasureResource.IfcHeatingValueMeasure)DataValue);
				if (DataValue is MeasureResource.IfcIlluminanceMeasure) 
					return new Ifc4.MeasureResource.IfcIlluminanceMeasure((MeasureResource.IfcIlluminanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcInductanceMeasure) 
					return new Ifc4.MeasureResource.IfcInductanceMeasure((MeasureResource.IfcInductanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcIntegerCountRateMeasure) 
					return new Ifc4.MeasureResource.IfcIntegerCountRateMeasure((MeasureResource.IfcIntegerCountRateMeasure)DataValue);
				if (DataValue is MeasureResource.IfcIonConcentrationMeasure) 
					return new Ifc4.MeasureResource.IfcIonConcentrationMeasure((MeasureResource.IfcIonConcentrationMeasure)DataValue);
				if (DataValue is MeasureResource.IfcIsothermalMoistureCapacityMeasure) 
					return new Ifc4.MeasureResource.IfcIsothermalMoistureCapacityMeasure((MeasureResource.IfcIsothermalMoistureCapacityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcKinematicViscosityMeasure) 
					return new Ifc4.MeasureResource.IfcKinematicViscosityMeasure((MeasureResource.IfcKinematicViscosityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLinearForceMeasure) 
					return new Ifc4.MeasureResource.IfcLinearForceMeasure((MeasureResource.IfcLinearForceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLinearMomentMeasure) 
					return new Ifc4.MeasureResource.IfcLinearMomentMeasure((MeasureResource.IfcLinearMomentMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLinearStiffnessMeasure) 
					return new Ifc4.MeasureResource.IfcLinearStiffnessMeasure((MeasureResource.IfcLinearStiffnessMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLinearVelocityMeasure) 
					return new Ifc4.MeasureResource.IfcLinearVelocityMeasure((MeasureResource.IfcLinearVelocityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLuminousFluxMeasure) 
					return new Ifc4.MeasureResource.IfcLuminousFluxMeasure((MeasureResource.IfcLuminousFluxMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLuminousIntensityDistributionMeasure) 
					return new Ifc4.MeasureResource.IfcLuminousIntensityDistributionMeasure((MeasureResource.IfcLuminousIntensityDistributionMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMagneticFluxDensityMeasure) 
					return new Ifc4.MeasureResource.IfcMagneticFluxDensityMeasure((MeasureResource.IfcMagneticFluxDensityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMagneticFluxMeasure) 
					return new Ifc4.MeasureResource.IfcMagneticFluxMeasure((MeasureResource.IfcMagneticFluxMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMassDensityMeasure) 
					return new Ifc4.MeasureResource.IfcMassDensityMeasure((MeasureResource.IfcMassDensityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMassFlowRateMeasure) 
					return new Ifc4.MeasureResource.IfcMassFlowRateMeasure((MeasureResource.IfcMassFlowRateMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMassPerLengthMeasure) 
					return new Ifc4.MeasureResource.IfcMassPerLengthMeasure((MeasureResource.IfcMassPerLengthMeasure)DataValue);
				if (DataValue is MeasureResource.IfcModulusOfElasticityMeasure) 
					return new Ifc4.MeasureResource.IfcModulusOfElasticityMeasure((MeasureResource.IfcModulusOfElasticityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure) 
					return new Ifc4.MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure((MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure)DataValue);
				if (DataValue is MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure) 
					return new Ifc4.MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure((MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure)DataValue);
				if (DataValue is MeasureResource.IfcModulusOfSubgradeReactionMeasure) 
					return new Ifc4.MeasureResource.IfcModulusOfSubgradeReactionMeasure((MeasureResource.IfcModulusOfSubgradeReactionMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMoistureDiffusivityMeasure) 
					return new Ifc4.MeasureResource.IfcMoistureDiffusivityMeasure((MeasureResource.IfcMoistureDiffusivityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMolecularWeightMeasure) 
					return new Ifc4.MeasureResource.IfcMolecularWeightMeasure((MeasureResource.IfcMolecularWeightMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMomentOfInertiaMeasure) 
					return new Ifc4.MeasureResource.IfcMomentOfInertiaMeasure((MeasureResource.IfcMomentOfInertiaMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMonetaryMeasure) 
					return new Ifc4.MeasureResource.IfcMonetaryMeasure((MeasureResource.IfcMonetaryMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPHMeasure) 
					return new Ifc4.MeasureResource.IfcPHMeasure((MeasureResource.IfcPHMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPlanarForceMeasure) 
					return new Ifc4.MeasureResource.IfcPlanarForceMeasure((MeasureResource.IfcPlanarForceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPowerMeasure) 
					return new Ifc4.MeasureResource.IfcPowerMeasure((MeasureResource.IfcPowerMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPressureMeasure) 
					return new Ifc4.MeasureResource.IfcPressureMeasure((MeasureResource.IfcPressureMeasure)DataValue);
				if (DataValue is MeasureResource.IfcRadioActivityMeasure) 
					return new Ifc4.MeasureResource.IfcRadioActivityMeasure((MeasureResource.IfcRadioActivityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcRotationalFrequencyMeasure) 
					return new Ifc4.MeasureResource.IfcRotationalFrequencyMeasure((MeasureResource.IfcRotationalFrequencyMeasure)DataValue);
				if (DataValue is MeasureResource.IfcRotationalMassMeasure) 
					return new Ifc4.MeasureResource.IfcRotationalMassMeasure((MeasureResource.IfcRotationalMassMeasure)DataValue);
				if (DataValue is MeasureResource.IfcRotationalStiffnessMeasure) 
					return new Ifc4.MeasureResource.IfcRotationalStiffnessMeasure((MeasureResource.IfcRotationalStiffnessMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSectionModulusMeasure) 
					return new Ifc4.MeasureResource.IfcSectionModulusMeasure((MeasureResource.IfcSectionModulusMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSectionalAreaIntegralMeasure) 
					return new Ifc4.MeasureResource.IfcSectionalAreaIntegralMeasure((MeasureResource.IfcSectionalAreaIntegralMeasure)DataValue);
				if (DataValue is MeasureResource.IfcShearModulusMeasure) 
					return new Ifc4.MeasureResource.IfcShearModulusMeasure((MeasureResource.IfcShearModulusMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSoundPowerLevelMeasure) 
					return new Ifc4.MeasureResource.IfcSoundPowerMeasure((MeasureResource.IfcSoundPowerLevelMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSoundPowerMeasure) 
					return new Ifc4.MeasureResource.IfcSoundPowerMeasure((MeasureResource.IfcSoundPowerMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSoundPressureLevelMeasure) 
					return new Ifc4.MeasureResource.IfcSoundPressureMeasure((MeasureResource.IfcSoundPressureLevelMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSoundPressureMeasure) 
					return new Ifc4.MeasureResource.IfcSoundPressureMeasure((MeasureResource.IfcSoundPressureMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSpecificHeatCapacityMeasure) 
					return new Ifc4.MeasureResource.IfcSpecificHeatCapacityMeasure((MeasureResource.IfcSpecificHeatCapacityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcTemperatureGradientMeasure) 
					return new Ifc4.MeasureResource.IfcTemperatureGradientMeasure((MeasureResource.IfcTemperatureGradientMeasure)DataValue);
				if (DataValue is MeasureResource.IfcTemperatureRateOfChangeMeasure) 
					return new Ifc4.MeasureResource.IfcTemperatureRateOfChangeMeasure((MeasureResource.IfcTemperatureRateOfChangeMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermalAdmittanceMeasure) 
					return new Ifc4.MeasureResource.IfcThermalAdmittanceMeasure((MeasureResource.IfcThermalAdmittanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermalConductivityMeasure) 
					return new Ifc4.MeasureResource.IfcThermalConductivityMeasure((MeasureResource.IfcThermalConductivityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermalExpansionCoefficientMeasure) 
					return new Ifc4.MeasureResource.IfcThermalExpansionCoefficientMeasure((MeasureResource.IfcThermalExpansionCoefficientMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermalResistanceMeasure) 
					return new Ifc4.MeasureResource.IfcThermalResistanceMeasure((MeasureResource.IfcThermalResistanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermalTransmittanceMeasure) 
					return new Ifc4.MeasureResource.IfcThermalTransmittanceMeasure((MeasureResource.IfcThermalTransmittanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcTorqueMeasure) 
					return new Ifc4.MeasureResource.IfcTorqueMeasure((MeasureResource.IfcTorqueMeasure)DataValue);
				if (DataValue is MeasureResource.IfcVaporPermeabilityMeasure) 
					return new Ifc4.MeasureResource.IfcVaporPermeabilityMeasure((MeasureResource.IfcVaporPermeabilityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcVolumetricFlowRateMeasure) 
					return new Ifc4.MeasureResource.IfcVolumetricFlowRateMeasure((MeasureResource.IfcVolumetricFlowRateMeasure)DataValue);
				if (DataValue is MeasureResource.IfcWarpingConstantMeasure) 
					return new Ifc4.MeasureResource.IfcWarpingConstantMeasure((MeasureResource.IfcWarpingConstantMeasure)DataValue);
				if (DataValue is MeasureResource.IfcWarpingMomentMeasure) 
					return new Ifc4.MeasureResource.IfcWarpingMomentMeasure((MeasureResource.IfcWarpingMomentMeasure)DataValue);
				if (DataValue is MeasureResource.IfcAmountOfSubstanceMeasure) 
					return new Ifc4.MeasureResource.IfcAmountOfSubstanceMeasure((MeasureResource.IfcAmountOfSubstanceMeasure)DataValue);
				if (DataValue is MeasureResource.IfcAreaMeasure) 
					return new Ifc4.MeasureResource.IfcAreaMeasure((MeasureResource.IfcAreaMeasure)DataValue);
				if (DataValue is MeasureResource.IfcComplexNumber) 
					return new Ifc4.MeasureResource.IfcComplexNumber((MeasureResource.IfcComplexNumber)DataValue);
				if (DataValue is MeasureResource.IfcContextDependentMeasure) 
					return new Ifc4.MeasureResource.IfcContextDependentMeasure((MeasureResource.IfcContextDependentMeasure)DataValue);
				if (DataValue is MeasureResource.IfcCountMeasure) 
					return new Ifc4.MeasureResource.IfcCountMeasure((MeasureResource.IfcCountMeasure)DataValue);
				if (DataValue is MeasureResource.IfcDescriptiveMeasure) 
					return new Ifc4.MeasureResource.IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)DataValue);
				if (DataValue is MeasureResource.IfcElectricCurrentMeasure) 
					return new Ifc4.MeasureResource.IfcElectricCurrentMeasure((MeasureResource.IfcElectricCurrentMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLengthMeasure) 
					return new Ifc4.MeasureResource.IfcLengthMeasure((MeasureResource.IfcLengthMeasure)DataValue);
				if (DataValue is MeasureResource.IfcLuminousIntensityMeasure) 
					return new Ifc4.MeasureResource.IfcLuminousIntensityMeasure((MeasureResource.IfcLuminousIntensityMeasure)DataValue);
				if (DataValue is MeasureResource.IfcMassMeasure) 
					return new Ifc4.MeasureResource.IfcMassMeasure((MeasureResource.IfcMassMeasure)DataValue);
				if (DataValue is MeasureResource.IfcNonNegativeLengthMeasure) 
					return new Ifc4.MeasureResource.IfcNonNegativeLengthMeasure((MeasureResource.IfcNonNegativeLengthMeasure)DataValue);
				if (DataValue is MeasureResource.IfcNormalisedRatioMeasure) 
					return new Ifc4.MeasureResource.IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)DataValue);
				if (DataValue is MeasureResource.IfcNumericMeasure) 
					return new Ifc4.MeasureResource.IfcNumericMeasure((MeasureResource.IfcNumericMeasure)DataValue);
				if (DataValue is MeasureResource.IfcParameterValue) 
					return new Ifc4.MeasureResource.IfcParameterValue((MeasureResource.IfcParameterValue)DataValue);
				if (DataValue is MeasureResource.IfcPlaneAngleMeasure) 
					return new Ifc4.MeasureResource.IfcPlaneAngleMeasure((MeasureResource.IfcPlaneAngleMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPositiveLengthMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPositivePlaneAngleMeasure) 
					return new Ifc4.MeasureResource.IfcPositivePlaneAngleMeasure((MeasureResource.IfcPositivePlaneAngleMeasure)DataValue);
				if (DataValue is MeasureResource.IfcPositiveRatioMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)DataValue);
				if (DataValue is MeasureResource.IfcRatioMeasure) 
					return new Ifc4.MeasureResource.IfcRatioMeasure((MeasureResource.IfcRatioMeasure)DataValue);
				if (DataValue is MeasureResource.IfcSolidAngleMeasure) 
					return new Ifc4.MeasureResource.IfcSolidAngleMeasure((MeasureResource.IfcSolidAngleMeasure)DataValue);
				if (DataValue is MeasureResource.IfcThermodynamicTemperatureMeasure) 
					return new Ifc4.MeasureResource.IfcThermodynamicTemperatureMeasure((MeasureResource.IfcThermodynamicTemperatureMeasure)DataValue);
				if (DataValue is MeasureResource.IfcTimeMeasure) 
					return new Ifc4.MeasureResource.IfcTimeMeasure((MeasureResource.IfcTimeMeasure)DataValue);
				if (DataValue is MeasureResource.IfcVolumeMeasure) 
					return new Ifc4.MeasureResource.IfcVolumeMeasure((MeasureResource.IfcVolumeMeasure)DataValue);
				if (DataValue is MeasureResource.IfcBinary) 
					return new Ifc4.MeasureResource.IfcBinary((MeasureResource.IfcBinary)DataValue);
				if (DataValue is MeasureResource.IfcBoolean) 
					return new Ifc4.MeasureResource.IfcBoolean((MeasureResource.IfcBoolean)DataValue);
				if (DataValue is DateTimeResource.IfcDate) 
					return new Ifc4.DateTimeResource.IfcDate((DateTimeResource.IfcDate)DataValue);
				if (DataValue is DateTimeResource.IfcDateTime) 
					return new Ifc4.DateTimeResource.IfcDateTime((DateTimeResource.IfcDateTime)DataValue);
				if (DataValue is DateTimeResource.IfcDuration) 
					return new Ifc4.DateTimeResource.IfcDuration((DateTimeResource.IfcDuration)DataValue);
				if (DataValue is MeasureResource.IfcIdentifier) 
					return new Ifc4.MeasureResource.IfcIdentifier((MeasureResource.IfcIdentifier)DataValue);
				if (DataValue is MeasureResource.IfcInteger) 
					return new Ifc4.MeasureResource.IfcInteger((MeasureResource.IfcInteger)DataValue);
				if (DataValue is MeasureResource.IfcLabel) 
					return new Ifc4.MeasureResource.IfcLabel((MeasureResource.IfcLabel)DataValue);
				if (DataValue is MeasureResource.IfcLogical) 
					return new Ifc4.MeasureResource.IfcLogical((MeasureResource.IfcLogical)DataValue);
				if (DataValue is MeasureResource.IfcPositiveInteger) 
					return new Ifc4.MeasureResource.IfcPositiveInteger((MeasureResource.IfcPositiveInteger)DataValue);
				if (DataValue is MeasureResource.IfcReal) 
					return new Ifc4.MeasureResource.IfcReal((MeasureResource.IfcReal)DataValue);
				if (DataValue is MeasureResource.IfcText) 
					return new Ifc4.MeasureResource.IfcText((MeasureResource.IfcText)DataValue);
				if (DataValue is DateTimeResource.IfcTime) 
					return new Ifc4.DateTimeResource.IfcTime((DateTimeResource.IfcTime)DataValue);
				if (DataValue is DateTimeResource.IfcTimeStamp) 
					return new Ifc4.DateTimeResource.IfcTimeStamp((DateTimeResource.IfcTimeStamp)DataValue);
				if (DataValue is MeasureResource.IfcURIReference)
                    //## Handle defined type IfcURIReference which is not a part of the target select interface IIfcMetricValueSelect in property DataValue
                    return new Ifc4.MeasureResource.IfcText(((MeasureResource.IfcURIReference)DataValue).Value.ToString());
					//##
				return null;
			} 
			set
			{
				if (value == null)
				{
					DataValue = null;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}	
				var ifcappliedvalue = value as CostResource.IfcAppliedValue;
				if (ifcappliedvalue != null) 
				{
					DataValue = ifcappliedvalue;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				var ifcmeasurewithunit = value as MeasureResource.IfcMeasureWithUnit;
				if (ifcmeasurewithunit != null) 
				{
					DataValue = ifcmeasurewithunit;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				var ifcreference = value as IfcReference;
				if (ifcreference != null) 
				{
					DataValue = ifcreference;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				var ifctable = value as UtilityResource.IfcTable;
				if (ifctable != null) 
				{
					DataValue = ifctable;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				var ifctimeseries = value as DateTimeResource.IfcTimeSeries;
				if (ifctimeseries != null) 
				{
					DataValue = ifctimeseries;
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAbsorbedDoseMeasure) 
				{
					DataValue = new MeasureResource.IfcAbsorbedDoseMeasure((Ifc4.MeasureResource.IfcAbsorbedDoseMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAccelerationMeasure) 
				{
					DataValue = new MeasureResource.IfcAccelerationMeasure((Ifc4.MeasureResource.IfcAccelerationMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAngularVelocityMeasure) 
				{
					DataValue = new MeasureResource.IfcAngularVelocityMeasure((Ifc4.MeasureResource.IfcAngularVelocityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAreaDensityMeasure) 
				{
					DataValue = new MeasureResource.IfcAreaDensityMeasure((Ifc4.MeasureResource.IfcAreaDensityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcCompoundPlaneAngleMeasure) 
				{
					DataValue = new MeasureResource.IfcCompoundPlaneAngleMeasure((Ifc4.MeasureResource.IfcCompoundPlaneAngleMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcCurvatureMeasure) 
				{
					DataValue = new MeasureResource.IfcCurvatureMeasure((Ifc4.MeasureResource.IfcCurvatureMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcDoseEquivalentMeasure) 
				{
					DataValue = new MeasureResource.IfcDoseEquivalentMeasure((Ifc4.MeasureResource.IfcDoseEquivalentMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcDynamicViscosityMeasure) 
				{
					DataValue = new MeasureResource.IfcDynamicViscosityMeasure((Ifc4.MeasureResource.IfcDynamicViscosityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricCapacitanceMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricCapacitanceMeasure((Ifc4.MeasureResource.IfcElectricCapacitanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricChargeMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricChargeMeasure((Ifc4.MeasureResource.IfcElectricChargeMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricConductanceMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricConductanceMeasure((Ifc4.MeasureResource.IfcElectricConductanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricResistanceMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricResistanceMeasure((Ifc4.MeasureResource.IfcElectricResistanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricVoltageMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricVoltageMeasure((Ifc4.MeasureResource.IfcElectricVoltageMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcEnergyMeasure) 
				{
					DataValue = new MeasureResource.IfcEnergyMeasure((Ifc4.MeasureResource.IfcEnergyMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcForceMeasure) 
				{
					DataValue = new MeasureResource.IfcForceMeasure((Ifc4.MeasureResource.IfcForceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcFrequencyMeasure) 
				{
					DataValue = new MeasureResource.IfcFrequencyMeasure((Ifc4.MeasureResource.IfcFrequencyMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcHeatFluxDensityMeasure) 
				{
					DataValue = new MeasureResource.IfcHeatFluxDensityMeasure((Ifc4.MeasureResource.IfcHeatFluxDensityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcHeatingValueMeasure) 
				{
					DataValue = new MeasureResource.IfcHeatingValueMeasure((Ifc4.MeasureResource.IfcHeatingValueMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcIlluminanceMeasure) 
				{
					DataValue = new MeasureResource.IfcIlluminanceMeasure((Ifc4.MeasureResource.IfcIlluminanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcInductanceMeasure) 
				{
					DataValue = new MeasureResource.IfcInductanceMeasure((Ifc4.MeasureResource.IfcInductanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcIntegerCountRateMeasure) 
				{
					DataValue = new MeasureResource.IfcIntegerCountRateMeasure((Ifc4.MeasureResource.IfcIntegerCountRateMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcIonConcentrationMeasure) 
				{
					DataValue = new MeasureResource.IfcIonConcentrationMeasure((Ifc4.MeasureResource.IfcIonConcentrationMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcIsothermalMoistureCapacityMeasure) 
				{
					DataValue = new MeasureResource.IfcIsothermalMoistureCapacityMeasure((Ifc4.MeasureResource.IfcIsothermalMoistureCapacityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcKinematicViscosityMeasure) 
				{
					DataValue = new MeasureResource.IfcKinematicViscosityMeasure((Ifc4.MeasureResource.IfcKinematicViscosityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLinearForceMeasure) 
				{
					DataValue = new MeasureResource.IfcLinearForceMeasure((Ifc4.MeasureResource.IfcLinearForceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLinearMomentMeasure) 
				{
					DataValue = new MeasureResource.IfcLinearMomentMeasure((Ifc4.MeasureResource.IfcLinearMomentMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLinearStiffnessMeasure) 
				{
					DataValue = new MeasureResource.IfcLinearStiffnessMeasure((Ifc4.MeasureResource.IfcLinearStiffnessMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLinearVelocityMeasure) 
				{
					DataValue = new MeasureResource.IfcLinearVelocityMeasure((Ifc4.MeasureResource.IfcLinearVelocityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLuminousFluxMeasure) 
				{
					DataValue = new MeasureResource.IfcLuminousFluxMeasure((Ifc4.MeasureResource.IfcLuminousFluxMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLuminousIntensityDistributionMeasure) 
				{
					DataValue = new MeasureResource.IfcLuminousIntensityDistributionMeasure((Ifc4.MeasureResource.IfcLuminousIntensityDistributionMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMagneticFluxDensityMeasure) 
				{
					DataValue = new MeasureResource.IfcMagneticFluxDensityMeasure((Ifc4.MeasureResource.IfcMagneticFluxDensityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMagneticFluxMeasure) 
				{
					DataValue = new MeasureResource.IfcMagneticFluxMeasure((Ifc4.MeasureResource.IfcMagneticFluxMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMassDensityMeasure) 
				{
					DataValue = new MeasureResource.IfcMassDensityMeasure((Ifc4.MeasureResource.IfcMassDensityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMassFlowRateMeasure) 
				{
					DataValue = new MeasureResource.IfcMassFlowRateMeasure((Ifc4.MeasureResource.IfcMassFlowRateMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMassPerLengthMeasure) 
				{
					DataValue = new MeasureResource.IfcMassPerLengthMeasure((Ifc4.MeasureResource.IfcMassPerLengthMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcModulusOfElasticityMeasure) 
				{
					DataValue = new MeasureResource.IfcModulusOfElasticityMeasure((Ifc4.MeasureResource.IfcModulusOfElasticityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure) 
				{
					DataValue = new MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure((Ifc4.MeasureResource.IfcModulusOfLinearSubgradeReactionMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure) 
				{
					DataValue = new MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure((Ifc4.MeasureResource.IfcModulusOfRotationalSubgradeReactionMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcModulusOfSubgradeReactionMeasure) 
				{
					DataValue = new MeasureResource.IfcModulusOfSubgradeReactionMeasure((Ifc4.MeasureResource.IfcModulusOfSubgradeReactionMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMoistureDiffusivityMeasure) 
				{
					DataValue = new MeasureResource.IfcMoistureDiffusivityMeasure((Ifc4.MeasureResource.IfcMoistureDiffusivityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMolecularWeightMeasure) 
				{
					DataValue = new MeasureResource.IfcMolecularWeightMeasure((Ifc4.MeasureResource.IfcMolecularWeightMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMomentOfInertiaMeasure) 
				{
					DataValue = new MeasureResource.IfcMomentOfInertiaMeasure((Ifc4.MeasureResource.IfcMomentOfInertiaMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMonetaryMeasure) 
				{
					DataValue = new MeasureResource.IfcMonetaryMeasure((Ifc4.MeasureResource.IfcMonetaryMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPHMeasure) 
				{
					DataValue = new MeasureResource.IfcPHMeasure((Ifc4.MeasureResource.IfcPHMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPlanarForceMeasure) 
				{
					DataValue = new MeasureResource.IfcPlanarForceMeasure((Ifc4.MeasureResource.IfcPlanarForceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPowerMeasure) 
				{
					DataValue = new MeasureResource.IfcPowerMeasure((Ifc4.MeasureResource.IfcPowerMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPressureMeasure) 
				{
					DataValue = new MeasureResource.IfcPressureMeasure((Ifc4.MeasureResource.IfcPressureMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRadioActivityMeasure) 
				{
					DataValue = new MeasureResource.IfcRadioActivityMeasure((Ifc4.MeasureResource.IfcRadioActivityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRotationalFrequencyMeasure) 
				{
					DataValue = new MeasureResource.IfcRotationalFrequencyMeasure((Ifc4.MeasureResource.IfcRotationalFrequencyMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRotationalMassMeasure) 
				{
					DataValue = new MeasureResource.IfcRotationalMassMeasure((Ifc4.MeasureResource.IfcRotationalMassMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRotationalStiffnessMeasure) 
				{
					DataValue = new MeasureResource.IfcRotationalStiffnessMeasure((Ifc4.MeasureResource.IfcRotationalStiffnessMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSectionModulusMeasure) 
				{
					DataValue = new MeasureResource.IfcSectionModulusMeasure((Ifc4.MeasureResource.IfcSectionModulusMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSectionalAreaIntegralMeasure) 
				{
					DataValue = new MeasureResource.IfcSectionalAreaIntegralMeasure((Ifc4.MeasureResource.IfcSectionalAreaIntegralMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcShearModulusMeasure) 
				{
					DataValue = new MeasureResource.IfcShearModulusMeasure((Ifc4.MeasureResource.IfcShearModulusMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSoundPowerLevelMeasure) 
				{
					DataValue = new MeasureResource.IfcSoundPowerMeasure((Ifc4.MeasureResource.IfcSoundPowerLevelMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSoundPowerMeasure) 
				{
					DataValue = new MeasureResource.IfcSoundPowerMeasure((Ifc4.MeasureResource.IfcSoundPowerMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSoundPressureLevelMeasure) 
				{
					DataValue = new MeasureResource.IfcSoundPressureMeasure((Ifc4.MeasureResource.IfcSoundPressureLevelMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSoundPressureMeasure) 
				{
					DataValue = new MeasureResource.IfcSoundPressureMeasure((Ifc4.MeasureResource.IfcSoundPressureMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSpecificHeatCapacityMeasure) 
				{
					DataValue = new MeasureResource.IfcSpecificHeatCapacityMeasure((Ifc4.MeasureResource.IfcSpecificHeatCapacityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcTemperatureGradientMeasure) 
				{
					DataValue = new MeasureResource.IfcTemperatureGradientMeasure((Ifc4.MeasureResource.IfcTemperatureGradientMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcTemperatureRateOfChangeMeasure) 
				{
					DataValue = new MeasureResource.IfcTemperatureRateOfChangeMeasure((Ifc4.MeasureResource.IfcTemperatureRateOfChangeMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermalAdmittanceMeasure) 
				{
					DataValue = new MeasureResource.IfcThermalAdmittanceMeasure((Ifc4.MeasureResource.IfcThermalAdmittanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermalConductivityMeasure) 
				{
					DataValue = new MeasureResource.IfcThermalConductivityMeasure((Ifc4.MeasureResource.IfcThermalConductivityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermalExpansionCoefficientMeasure) 
				{
					DataValue = new MeasureResource.IfcThermalExpansionCoefficientMeasure((Ifc4.MeasureResource.IfcThermalExpansionCoefficientMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermalResistanceMeasure) 
				{
					DataValue = new MeasureResource.IfcThermalResistanceMeasure((Ifc4.MeasureResource.IfcThermalResistanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermalTransmittanceMeasure) 
				{
					DataValue = new MeasureResource.IfcThermalTransmittanceMeasure((Ifc4.MeasureResource.IfcThermalTransmittanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcTorqueMeasure) 
				{
					DataValue = new MeasureResource.IfcTorqueMeasure((Ifc4.MeasureResource.IfcTorqueMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcVaporPermeabilityMeasure) 
				{
					DataValue = new MeasureResource.IfcVaporPermeabilityMeasure((Ifc4.MeasureResource.IfcVaporPermeabilityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcVolumetricFlowRateMeasure) 
				{
					DataValue = new MeasureResource.IfcVolumetricFlowRateMeasure((Ifc4.MeasureResource.IfcVolumetricFlowRateMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcWarpingConstantMeasure) 
				{
					DataValue = new MeasureResource.IfcWarpingConstantMeasure((Ifc4.MeasureResource.IfcWarpingConstantMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcWarpingMomentMeasure) 
				{
					DataValue = new MeasureResource.IfcWarpingMomentMeasure((Ifc4.MeasureResource.IfcWarpingMomentMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAmountOfSubstanceMeasure) 
				{
					DataValue = new MeasureResource.IfcAmountOfSubstanceMeasure((Ifc4.MeasureResource.IfcAmountOfSubstanceMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcAreaMeasure) 
				{
					DataValue = new MeasureResource.IfcAreaMeasure((Ifc4.MeasureResource.IfcAreaMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcComplexNumber) 
				{
					DataValue = new MeasureResource.IfcComplexNumber((Ifc4.MeasureResource.IfcComplexNumber)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcContextDependentMeasure) 
				{
					DataValue = new MeasureResource.IfcContextDependentMeasure((Ifc4.MeasureResource.IfcContextDependentMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcCountMeasure) 
				{
					DataValue = new MeasureResource.IfcCountMeasure((Ifc4.MeasureResource.IfcCountMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcDescriptiveMeasure) 
				{
					DataValue = new MeasureResource.IfcDescriptiveMeasure((Ifc4.MeasureResource.IfcDescriptiveMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcElectricCurrentMeasure) 
				{
					DataValue = new MeasureResource.IfcElectricCurrentMeasure((Ifc4.MeasureResource.IfcElectricCurrentMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLengthMeasure) 
				{
					DataValue = new MeasureResource.IfcLengthMeasure((Ifc4.MeasureResource.IfcLengthMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLuminousIntensityMeasure) 
				{
					DataValue = new MeasureResource.IfcLuminousIntensityMeasure((Ifc4.MeasureResource.IfcLuminousIntensityMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcMassMeasure) 
				{
					DataValue = new MeasureResource.IfcMassMeasure((Ifc4.MeasureResource.IfcMassMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNonNegativeLengthMeasure) 
				{
					DataValue = new MeasureResource.IfcNonNegativeLengthMeasure((Ifc4.MeasureResource.IfcNonNegativeLengthMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNormalisedRatioMeasure) 
				{
					DataValue = new MeasureResource.IfcNormalisedRatioMeasure((Ifc4.MeasureResource.IfcNormalisedRatioMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNumericMeasure) 
				{
					DataValue = new MeasureResource.IfcNumericMeasure((Ifc4.MeasureResource.IfcNumericMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcParameterValue) 
				{
					DataValue = new MeasureResource.IfcParameterValue((Ifc4.MeasureResource.IfcParameterValue)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPlaneAngleMeasure) 
				{
					DataValue = new MeasureResource.IfcPlaneAngleMeasure((Ifc4.MeasureResource.IfcPlaneAngleMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveLengthMeasure) 
				{
					DataValue = new MeasureResource.IfcPositiveLengthMeasure((Ifc4.MeasureResource.IfcPositiveLengthMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositivePlaneAngleMeasure) 
				{
					DataValue = new MeasureResource.IfcPositivePlaneAngleMeasure((Ifc4.MeasureResource.IfcPositivePlaneAngleMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveRatioMeasure) 
				{
					DataValue = new MeasureResource.IfcPositiveRatioMeasure((Ifc4.MeasureResource.IfcPositiveRatioMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRatioMeasure) 
				{
					DataValue = new MeasureResource.IfcRatioMeasure((Ifc4.MeasureResource.IfcRatioMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcSolidAngleMeasure) 
				{
					DataValue = new MeasureResource.IfcSolidAngleMeasure((Ifc4.MeasureResource.IfcSolidAngleMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcThermodynamicTemperatureMeasure) 
				{
					DataValue = new MeasureResource.IfcThermodynamicTemperatureMeasure((Ifc4.MeasureResource.IfcThermodynamicTemperatureMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcTimeMeasure) 
				{
					DataValue = new MeasureResource.IfcTimeMeasure((Ifc4.MeasureResource.IfcTimeMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcVolumeMeasure) 
				{
					DataValue = new MeasureResource.IfcVolumeMeasure((Ifc4.MeasureResource.IfcVolumeMeasure)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcBinary) 
				{
					DataValue = new MeasureResource.IfcBinary((Ifc4.MeasureResource.IfcBinary)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcBoolean) 
				{
					DataValue = new MeasureResource.IfcBoolean((Ifc4.MeasureResource.IfcBoolean)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.DateTimeResource.IfcDate) 
				{
					DataValue = new DateTimeResource.IfcDate((Ifc4.DateTimeResource.IfcDate)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.DateTimeResource.IfcDateTime) 
				{
					DataValue = new DateTimeResource.IfcDateTime((Ifc4.DateTimeResource.IfcDateTime)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.DateTimeResource.IfcDuration) 
				{
					DataValue = new DateTimeResource.IfcDuration((Ifc4.DateTimeResource.IfcDuration)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcIdentifier) 
				{
					DataValue = new MeasureResource.IfcIdentifier((Ifc4.MeasureResource.IfcIdentifier)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcInteger) 
				{
					DataValue = new MeasureResource.IfcInteger((Ifc4.MeasureResource.IfcInteger)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLabel) 
				{
					DataValue = new MeasureResource.IfcLabel((Ifc4.MeasureResource.IfcLabel)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLogical) 
				{
					DataValue = new MeasureResource.IfcLogical((Ifc4.MeasureResource.IfcLogical)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveInteger) 
				{
					DataValue = new MeasureResource.IfcPositiveInteger((Ifc4.MeasureResource.IfcPositiveInteger)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcReal) 
				{
					DataValue = new MeasureResource.IfcReal((Ifc4.MeasureResource.IfcReal)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcText) 
				{
					DataValue = new MeasureResource.IfcText((Ifc4.MeasureResource.IfcText)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.DateTimeResource.IfcTime) 
				{
					DataValue = new DateTimeResource.IfcTime((Ifc4.DateTimeResource.IfcTime)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				if (value is Ifc4.DateTimeResource.IfcTimeStamp) 
				{
					DataValue = new DateTimeResource.IfcTimeStamp((Ifc4.DateTimeResource.IfcTimeStamp)value);
					if (_dataValue4 != null)
						SetValue(v => _dataValue4 = v, _dataValue4, null, "DataValue", -10);
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMetric), 11)]
		IIfcReference IIfcMetric.ReferencePath 
		{ 
			get
			{
				return ReferencePath;
			} 
			set
			{
				ReferencePath = value as IfcReference;
				
			}
		}
	//## Custom code
	//##
	}
}