Пример #1
0
 public IfcInventory(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcInventoryTypeEnum?__PredefinedType, IfcActorSelect __Jurisdiction, IfcPerson[] __ResponsiblePersons, IfcDate?__LastUpdateDate, IfcCostValue __CurrentValue, IfcCostValue __OriginalValue)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType)
 {
     this.PredefinedType     = __PredefinedType;
     this.Jurisdiction       = __Jurisdiction;
     this.ResponsiblePersons = new HashSet <IfcPerson>(__ResponsiblePersons);
     this.LastUpdateDate     = __LastUpdateDate;
     this.CurrentValue       = __CurrentValue;
     this.OriginalValue      = __OriginalValue;
 }
Пример #2
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 5:
                _assetID = value.StringVal;
                return;

            case 6:
                _originalValue = (IfcCostValue)(value.EntityVal);
                return;

            case 7:
                _currentValue = (IfcCostValue)(value.EntityVal);
                return;

            case 8:
                _totalReplacementCost = (IfcCostValue)(value.EntityVal);
                return;

            case 9:
                _owner = (IfcActorSelect)(value.EntityVal);
                return;

            case 10:
                _user = (IfcActorSelect)(value.EntityVal);
                return;

            case 11:
                _responsiblePerson = (IfcPerson)(value.EntityVal);
                return;

            case 12:
                _incorporationDate = (IfcCalendarDate)(value.EntityVal);
                return;

            case 13:
                _depreciatedValue = (IfcCostValue)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Пример #3
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.IfcParse(propIndex, value);
                break;

            case 5:
                _AssetID = value.StringVal;
                break;

            case 6:
                _OriginalValue = (IfcCostValue)value.EntityVal;
                break;

            case 7:
                _CurrentValue = (IfcCostValue)value.EntityVal;
                break;

            case 8:
                _TotalReplacementCost = (IfcCostValue)value.EntityVal;
                break;

            case 9:
                _Owner = (IfcActorSelect)value.EntityVal;
                break;

            case 10:
                _User = (IfcActorSelect)value.EntityVal;
                break;

            case 11:
                _ResponsiblePerson = (IfcPerson)value.EntityVal;
                break;

            case 12:
                _IncorporationDate = (IfcCalendarDate)value.EntityVal;
                break;

            case 13:
                _DepreciatedValue = (IfcCostValue)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Пример #4
0
 public IfcAsset(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcIdentifier?__Identification, IfcCostValue __OriginalValue, IfcCostValue __CurrentValue, IfcCostValue __TotalReplacementCost, IfcActorSelect __Owner, IfcActorSelect __User, IfcPerson __ResponsiblePerson, IfcDate?__IncorporationDate, IfcCostValue __DepreciatedValue)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType)
 {
     this.Identification       = __Identification;
     this.OriginalValue        = __OriginalValue;
     this.CurrentValue         = __CurrentValue;
     this.TotalReplacementCost = __TotalReplacementCost;
     this.Owner             = __Owner;
     this.User              = __User;
     this.ResponsiblePerson = __ResponsiblePerson;
     this.IncorporationDate = __IncorporationDate;
     this.DepreciatedValue  = __DepreciatedValue;
 }
Пример #5
0
 internal IfcInventory(DatabaseIfc db, IfcInventory i, DuplicateOptions options) : base(db, i, options)
 {
     PredefinedType = i.PredefinedType;
     mJurisdiction  = db.Factory.Duplicate(i.mJurisdiction, options);
     mResponsiblePersons.AddRange(i.mResponsiblePersons.Select(x => db.Factory.Duplicate(x, options)));
     mLastUpdateDate = i.mLastUpdateDate;
     if (mLastUpdateDateSS != null)
     {
         mLastUpdateDateSS = db.Factory.Duplicate(i.mLastUpdateDateSS, options);
     }
     if (i.mCurrentValue != null)
     {
         mCurrentValue = db.Factory.Duplicate(i.mCurrentValue, options);
     }
     if (i.mOriginalValue != null)
     {
         mOriginalValue = db.Factory.Duplicate(i.mOriginalValue, options);
     }
 }
Пример #6
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 5:
                _inventoryType = (IfcInventoryTypeEnum)System.Enum.Parse(typeof(IfcInventoryTypeEnum), value.EnumVal, true);
                return;

            case 6:
                _jurisdiction = (IfcActorSelect)(value.EntityVal);
                return;

            case 7:
                _responsiblePersons.InternalAdd((IfcPerson)value.EntityVal);
                return;

            case 8:
                _lastUpdateDate = (IfcCalendarDate)(value.EntityVal);
                return;

            case 9:
                _currentValue = (IfcCostValue)(value.EntityVal);
                return;

            case 10:
                _originalValue = (IfcCostValue)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Пример #7
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.IfcParse(propIndex, value);
                break;

            case 5:
                _InventoryType = (IfcInventoryTypeEnum)Enum.Parse(typeof(IfcInventoryTypeEnum), value.EnumVal);
                break;

            case 6:
                _Jurisdiction = (IfcActorSelect)value.EntityVal;
                break;

            case 7:
                _ResponsiblePersons.Add((IfcPerson)value.EntityVal);
                break;

            case 8:
                _LastUpdateDate = (IfcCalendarDate)value.EntityVal;
                break;

            case 9:
                _CurrentValue = (IfcCostValue)value.EntityVal;
                break;

            case 10:
                _OriginalValue = (IfcCostValue)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public static string GetAsString(this IfcAppliedValue ifcAppliedValue)
        {
            StringBuilder value = new StringBuilder();

            if ((ifcAppliedValue.Description.HasValue) &&
                (!string.IsNullOrEmpty(ifcAppliedValue.Description))
                )
            {
                value.Append(ifcAppliedValue.Description);
                value.Append(", ");
            }

            if (ifcAppliedValue.Value != null)//not nullable should be? incorrect name?
            {
                value.Append("AppliedValue: ");
                if (ifcAppliedValue.Value is IfcRatioMeasure)
                {
                    IfcRatioMeasure ifcRatioMeasure = (IfcRatioMeasure)ifcAppliedValue.Value;
                    value.Append(string.Format("{0,0:N2}", ifcRatioMeasure.Value));
                }
                if (ifcAppliedValue.Value is IfcMonetaryMeasure)
                {
                    IfcMonetaryMeasure ifcMonetaryMeasure = (IfcMonetaryMeasure)ifcAppliedValue.Value;
                    value.Append(string.Format("{0,0:N2}", ifcMonetaryMeasure.Value));
                }
                if (ifcAppliedValue.Value is IfcMeasureWithUnit)
                {
                    value.Append(GetMeasureWithUnitAsString((IfcMeasureWithUnit)ifcAppliedValue.Value));
                }
                value.Append(", ");
            }

            if (ifcAppliedValue.UnitBasis != null) //not nullable should be?
            {
                value.Append("UnitBase: ");
                value.Append(GetMeasureWithUnitAsString((IfcMeasureWithUnit)ifcAppliedValue.UnitBasis));
                value.Append(", ");
            }
            if (ifcAppliedValue.ApplicableDate != null) //not nullable should be?
            {
                value.Append("ApplicableDate: ");
                value.Append(ifcAppliedValue.ApplicableDate.GetAsString());
                value.Append(", ");
            }
            if (ifcAppliedValue.FixedUntilDate != null) //not nullable should be?
            {
                value.Append("FixedUntilDate: ");
                value.Append(ifcAppliedValue.FixedUntilDate.GetAsString());
                value.Append(", ");
            }

            if (ifcAppliedValue is IfcCostValue)
            {
                IfcCostValue ifcCostValue = (IfcCostValue)ifcAppliedValue;
                if (ifcCostValue.CostType != null)
                {
                    value.Append("CostType: ");
                    value.Append(ifcCostValue.CostType);
                    value.Append(", ");
                }

                if (ifcCostValue.Condition != null)//not nullable should be?
                {
                    value.Append("Condition: ");
                    value.Append(ifcCostValue.Condition);
                    value.Append(", ");
                }
            }
            if (ifcAppliedValue is IfcEnvironmentalImpactValue)
            {
                IfcEnvironmentalImpactValue ifcEnvironmentalImpactValue = (IfcEnvironmentalImpactValue)ifcAppliedValue;
                if (ifcEnvironmentalImpactValue.ImpactType != null)
                {
                    value.Append("ImpactType: ");
                    value.Append(ifcEnvironmentalImpactValue.ImpactType);
                    value.Append(", ");
                }

                //enum so should have a value as not nullable
                value.Append("Category: ");
                value.Append(ifcEnvironmentalImpactValue.Category.ToString());
                value.Append(", ");

                if (ifcEnvironmentalImpactValue.UserDefinedCategory != null)//not nullable should be?
                {
                    value.Append("UserDefinedCategory: ");
                    value.Append(ifcEnvironmentalImpactValue.UserDefinedCategory);
                    value.Append(", ");
                }
            }
            return(value.ToString());
        }
Пример #9
0
        private static void CreateSimpleProperty(XbimModel model, IfcWallStandardCase wall, IfcOwnerHistory ifcOwnerHistory)
        {
            IfcPropertySingleValue ifcPropertySingleValue = model.Instances.New <IfcPropertySingleValue>(psv =>
            {
                psv.Name         = "IfcPropertySingleValue:Time";
                psv.Description  = "";
                psv.NominalValue = new IfcTimeMeasure(150.0);
                psv.Unit         = model.Instances.New <IfcSIUnit>(siu =>
                {
                    siu.UnitType   = IfcUnitEnum.TIMEUNIT;
                    siu.Name       = IfcSIUnitName.SECOND;
                    siu.Dimensions = model.Instances.New <IfcDimensionalExponents>(de =>
                    {
                        de.LengthExponent                   = 0;
                        de.MassExponent                     = 0;
                        de.TimeExponent                     = 1;
                        de.ElectricCurrentExponent          = 0;
                        de.ThermodynamicTemperatureExponent = 0;
                        de.AmountOfSubstanceExponent        = 0;
                        de.LuminousIntensityExponent        = 0;
                    });
                });
            });
            IfcPropertyEnumeratedValue ifcPropertyEnumeratedValue = model.Instances.New <IfcPropertyEnumeratedValue>(pev =>
            {
                pev.Name = "IfcPropertyEnumeratedValue:Music";
                pev.EnumerationReference = model.Instances.New <IfcPropertyEnumeration>(pe =>
                {
                    pe.Name = "Notes";
                    pe.EnumerationValues.Add(new IfcLabel("Do"));
                    pe.EnumerationValues.Add(new IfcLabel("Re"));
                    pe.EnumerationValues.Add(new IfcLabel("Mi"));
                    pe.EnumerationValues.Add(new IfcLabel("Fa"));
                    pe.EnumerationValues.Add(new IfcLabel("So"));
                    pe.EnumerationValues.Add(new IfcLabel("La"));
                    pe.EnumerationValues.Add(new IfcLabel("Ti"));
                });
                pev.EnumerationValues.Add(new IfcLabel("Do"));
                pev.EnumerationValues.Add(new IfcLabel("Re"));
                pev.EnumerationValues.Add(new IfcLabel("Mi"));
            });
            IfcPropertyBoundedValue ifcPropertyBoundedValue = model.Instances.New <IfcPropertyBoundedValue>(pbv =>
            {
                pbv.Name            = "IfcPropertyBoundedValue:Mass";
                pbv.Description     = "";
                pbv.UpperBoundValue = new IfcMassMeasure(5000.0);
                pbv.LowerBoundValue = new IfcMassMeasure(1000.0);
                pbv.Unit            = model.Instances.New <IfcSIUnit>(siu =>
                {
                    siu.UnitType   = IfcUnitEnum.MASSUNIT;
                    siu.Name       = IfcSIUnitName.GRAM;
                    siu.Prefix     = IfcSIPrefix.KILO;
                    siu.Dimensions = model.Instances.New <IfcDimensionalExponents>(de =>
                    {
                        de.LengthExponent                   = 0;
                        de.MassExponent                     = 1;
                        de.TimeExponent                     = 0;
                        de.ElectricCurrentExponent          = 0;
                        de.ThermodynamicTemperatureExponent = 0;
                        de.AmountOfSubstanceExponent        = 0;
                        de.LuminousIntensityExponent        = 0;
                    });
                });
            });

            List <IfcReal> definingValues = new List <IfcReal>()
            {
                new IfcReal(100.0), new IfcReal(200.0), new IfcReal(400.0), new IfcReal(800.0), new IfcReal(1600.0), new IfcReal(3200.0),
            };
            List <IfcReal> definedValues = new List <IfcReal>()
            {
                new IfcReal(20.0), new IfcReal(42.0), new IfcReal(46.0), new IfcReal(56.0), new IfcReal(60.0), new IfcReal(65.0),
            };
            IfcPropertyTableValue ifcPropertyTableValue = model.Instances.New <IfcPropertyTableValue>(ptv =>
            {
                ptv.Name = "IfcPropertyTableValue:Sound";
                foreach (var item in definingValues)
                {
                    ptv.DefiningValues.Add(item);
                }
                foreach (var item in definedValues)
                {
                    ptv.DefinedValues.Add(item);
                }
                ptv.DefinedUnit = model.Instances.New <IfcContextDependentUnit>(cd =>
                {
                    cd.Dimensions = model.Instances.New <IfcDimensionalExponents>(de =>
                    {
                        de.LengthExponent                   = 0;
                        de.MassExponent                     = 0;
                        de.TimeExponent                     = 0;
                        de.ElectricCurrentExponent          = 0;
                        de.ThermodynamicTemperatureExponent = 0;
                        de.AmountOfSubstanceExponent        = 0;
                        de.LuminousIntensityExponent        = 0;
                    });
                    cd.UnitType = IfcUnitEnum.FREQUENCYUNIT;
                    cd.Name     = "dB";
                });
            });

            List <IfcLabel> listValues = new List <IfcLabel>()
            {
                new IfcLabel("Red"), new IfcLabel("Green"), new IfcLabel("Blue"), new IfcLabel("Pink"), new IfcLabel("White"), new IfcLabel("Black"),
            };
            IfcPropertyListValue ifcPropertyListValue = model.Instances.New <IfcPropertyListValue>(plv =>
            {
                plv.Name = "IfcPropertyListValue:Colours";
                foreach (var item in listValues)
                {
                    plv.ListValues.Add(item);
                }
            });

            IfcMaterial IfcMaterial = model.Instances.New <IfcMaterial>(m =>
            {
                m.Name = "Brick";
            });
            IfcPropertyReferenceValue ifcPRValueMaterial = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Material";
                prv.PropertyReference = IfcMaterial;
            });

            IfcPropertyReferenceValue ifcPRValuePerson = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Person";
                prv.PropertyReference = ifcOwnerHistory.OwningUser.ThePerson;
            });

            IfcDateAndTime ifcDateAndTime = model.Instances.New <IfcDateAndTime>(dt =>
            {
                dt.DateComponent = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 25;
                    cd.MonthComponent = 3;
                    cd.YearComponent  = 2013;
                });
                dt.TimeComponent = model.Instances.New <IfcLocalTime>(lt =>
                {
                    lt.HourComponent   = 10;
                    lt.MinuteComponent = 30;
                    lt.SecondComponent = 0;
                });
            });
            IfcPropertyReferenceValue ifcPRValueDateTime = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:DateAndTime";
                prv.PropertyReference = ifcDateAndTime;
            });

            IfcMaterialList ifcMaterialList = model.Instances.New <IfcMaterialList>(ml =>
            {
                ml.Materials.Add(IfcMaterial);
                ml.Materials.Add(model.Instances.New <IfcMaterial>(m => { m.Name = "Cavity"; }));
                ml.Materials.Add(model.Instances.New <IfcMaterial>(m => { m.Name = "Block"; }));
            });
            IfcPropertyReferenceValue ifcPRValueMatList = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:MaterialList";
                prv.PropertyReference = ifcMaterialList;
            });

            IfcPropertyReferenceValue ifcPRValueOrg = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Organization";
                prv.PropertyReference = ifcOwnerHistory.OwningUser.TheOrganization;
            });

            IfcPropertyReferenceValue ifcPRValueDate = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Date";
                prv.PropertyReference = ifcDateAndTime.DateComponent;
            });

            IfcPropertyReferenceValue ifcPRValueTime = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Time";
                prv.PropertyReference = ifcDateAndTime.TimeComponent;
            });

            IfcPropertyReferenceValue ifcPRValuePersonOrg = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:PersonOrganization";
                prv.PropertyReference = ifcOwnerHistory.OwningUser;
            });

            IfcMaterialLayer ifcMaterialLayer = model.Instances.New <IfcMaterialLayer>(ml =>
            {
                ml.Material       = IfcMaterial;
                ml.LayerThickness = 100.0;
            });
            IfcPropertyReferenceValue ifcPRValueMatLayer = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:MaterialLayer";
                prv.PropertyReference = ifcMaterialLayer;
            });

            IfcDocumentReference ifcDocumentReference = model.Instances.New <IfcDocumentReference>(dr =>
            {
                dr.Name     = "Document";
                dr.Location = "c://Documents//TheDoc.Txt";
            });
            IfcPropertyReferenceValue ifcPRValueRef = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Document";
                prv.PropertyReference = ifcDocumentReference;
            });

            IfcRegularTimeSeries ifcTimeSeries = model.Instances.New <IfcRegularTimeSeries>(ts =>
            {
                ts.Name        = "Regular Time Series";
                ts.Description = "Time series of events";
                ts.StartTime   = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 01;
                    cd.MonthComponent = 1;
                    cd.YearComponent  = 2013;
                });
                ts.EndTime = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 01;
                    cd.MonthComponent = 3;
                    cd.YearComponent  = 2013;
                });
                ts.TimeSeriesDataType = IfcTimeSeriesDataTypeEnum.CONTINUOUS;
                ts.DataOrigin         = IfcDataOriginEnum.MEASURED;
                ts.TimeStep           = 604800; //7 days in secs
            });

            IfcPropertyReferenceValue ifcPRValueTimeSeries = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:TimeSeries";
                prv.PropertyReference = ifcTimeSeries;
            });

            IfcPostalAddress ifcAddress = model.Instances.New <IfcPostalAddress>(a =>
            {
                a.InternalLocation = "Room 101";
                a.SetAddressLines(new string[] { "12 New road", "DoxField" });
                a.Town       = "Sunderland";
                a.PostalCode = "DL01 6SX";
            });
            IfcPropertyReferenceValue ifcPRValueAddress = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Address";
                prv.PropertyReference = ifcAddress;
            });
            IfcTelecomAddress IfcTelecomAddress = model.Instances.New <IfcTelecomAddress>(a =>
            {
                a.SetTelephoneNumbers(new string[] { "01325 6589965" });
                a.SetElectronicMailAddress(new string[] { "*****@*****.**" });
            });
            IfcPropertyReferenceValue ifcPRValueTelecom = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:Telecom";
                prv.PropertyReference = IfcTelecomAddress;
            });

            IfcCostValue ifcCostValue = model.Instances.New <IfcCostValue>(cv =>
            {
                cv.Name           = "Cost Value";
                cv.Description    = "";
                cv.Value          = new IfcMonetaryMeasure(155.0);
                cv.ApplicableDate = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 02;
                    cd.MonthComponent = 02;
                    cd.YearComponent  = 2013;
                });
                cv.FixedUntilDate = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 31;
                    cd.MonthComponent = 12;
                    cd.YearComponent  = 2013;
                });
                cv.CostType  = "Annual rate of return";
                cv.Condition = "";
            });
            IfcPropertyReferenceValue ifcPRValueCostValue = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:CostValue";
                prv.PropertyReference = ifcCostValue;
            });


            IfcEnvironmentalImpactValue IfcEnvironmentalImpactValue = model.Instances.New <IfcEnvironmentalImpactValue>(cv =>
            {
                cv.Name        = "Environmental Impact";
                cv.Description = "";
                cv.Value       = model.Instances.New <IfcMeasureWithUnit>(mwu =>
                {
                    mwu.ValueComponent = new IfcReal(111.0);
                    mwu.UnitComponent  = model.Instances.New <IfcSIUnit>(siu =>
                    {
                        siu.UnitType   = IfcUnitEnum.LENGTHUNIT;
                        siu.Name       = IfcSIUnitName.METRE;
                        siu.Dimensions = model.Instances.New <IfcDimensionalExponents>(de =>
                        {
                            de.LengthExponent                   = 1;
                            de.MassExponent                     = 0;
                            de.TimeExponent                     = 0;
                            de.ElectricCurrentExponent          = 0;
                            de.ThermodynamicTemperatureExponent = 0;
                            de.AmountOfSubstanceExponent        = 0;
                            de.LuminousIntensityExponent        = 0;
                        });
                    });
                });
                cv.ApplicableDate = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 02;
                    cd.MonthComponent = 02;
                    cd.YearComponent  = 2013;
                });
                cv.FixedUntilDate = model.Instances.New <IfcCalendarDate>(cd =>
                {
                    cd.DayComponent   = 31;
                    cd.MonthComponent = 12;
                    cd.YearComponent  = 2013;
                });
                cv.ImpactType = "Embodied energy";
                cv.Category   = IfcEnvironmentalImpactCategoryEnum.MANUFACTURE;
            });
            IfcPropertyReferenceValue ifcPRValueEnvironmentalImpact = model.Instances.New <IfcPropertyReferenceValue>(prv =>
            {
                prv.Name = "IfcPropertyReferenceValue:EnvironmentalImpact";
                prv.PropertyReference = IfcEnvironmentalImpactValue;
            });

            //lets create the IfcElementQuantity
            IfcPropertySet ifcPropertySet = model.Instances.New <IfcPropertySet>(ps =>
            {
                ps.OwnerHistory = ifcOwnerHistory;
                ps.Name         = "Test:IfcPropertySet";
                ps.Description  = "Property Set";
                ps.HasProperties.Add(ifcPropertySingleValue);
                ps.HasProperties.Add(ifcPropertyEnumeratedValue);
                ps.HasProperties.Add(ifcPropertyBoundedValue);
                ps.HasProperties.Add(ifcPropertyTableValue);
                ps.HasProperties.Add(ifcPropertyListValue);
                ps.HasProperties.Add(ifcPRValueMaterial);
                ps.HasProperties.Add(ifcPRValuePerson);
                ps.HasProperties.Add(ifcPRValueDateTime);
                ps.HasProperties.Add(ifcPRValueMatList);
                ps.HasProperties.Add(ifcPRValueOrg);
                ps.HasProperties.Add(ifcPRValueDate);
                ps.HasProperties.Add(ifcPRValueTime);
                ps.HasProperties.Add(ifcPRValuePersonOrg);
                ps.HasProperties.Add(ifcPRValueMatLayer);
                ps.HasProperties.Add(ifcPRValueRef);
                ps.HasProperties.Add(ifcPRValueTimeSeries);
                ps.HasProperties.Add(ifcPRValueAddress);
                ps.HasProperties.Add(ifcPRValueTelecom);
                ps.HasProperties.Add(ifcPRValueCostValue);
                ps.HasProperties.Add(ifcPRValueEnvironmentalImpact);
            });

            //need to create the relationship
            IfcRelDefinesByProperties ifcRelDefinesByProperties = model.Instances.New <IfcRelDefinesByProperties>(rdbp =>
            {
                rdbp.OwnerHistory = ifcOwnerHistory;
                rdbp.Name         = "Property Association";
                rdbp.Description  = "IfcPropertySet associated to wall";
                rdbp.RelatedObjects.Add(wall);
                rdbp.RelatingPropertyDefinition = ifcPropertySet;
            });
        }