Exemple #1
0
        public void AddToHostObject(BbProduct hostObject)
        {
            HostObject = hostObject;
            var a = EarlyBindingInstanceModel.GetReferencedEntities(hostObject.IfcObject.EIN).Values;

            var b = (from x in a.OfType<IfcRelAggregates>()
                     where x.RelatingObject.EIN == hostObject.IfcObject.EIN
                     select x).ToList();

            switch (b.Count)
            {

                case 0:
                    IfcRelAggregates = new IfcRelAggregates
                    {
                        GlobalId = IfcGloballyUniqueId.NewGuid(),
                        OwnerHistory = hostObject.IfcObject.OwnerHistory,
                        RelatingObject = hostObject.IfcObject,
                        RelatedObjects = new List<IfcObjectDefinition>() { },
                    };
                    break;
                case 1:
                    IfcRelAggregates = b[0];
                    break;
                default:
                    throw new NotImplementedException();
            }
            var aa = GetType().GetProperty("IfcObject").GetValue(this, null) as IfcObject;

            IfcRelAggregates.RelatedObjects.Add(aa);
        }
Exemple #2
0
        public void AddToHostObject(BbProduct hostObject)
        {
            HostObject = hostObject;
            var a = EarlyBindingInstanceModel.GetReferencedEntities(hostObject.IfcObject.EIN).Values;

            var b = (from x in a.OfType <IfcRelAggregates>()
                     where x.RelatingObject.EIN == hostObject.IfcObject.EIN
                     select x).ToList();

            switch (b.Count)
            {
            case 0:
                IfcRelAggregates = new IfcRelAggregates
                {
                    GlobalId       = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory   = hostObject.IfcObject.OwnerHistory,
                    RelatingObject = hostObject.IfcObject,
                    RelatedObjects = new List <IfcObjectDefinition>()
                    {
                    },
                };
                break;

            case 1:
                IfcRelAggregates = b[0];
                break;

            default:
                throw new NotImplementedException();
            }
            var aa = GetType().GetProperty("IfcObject").GetValue(this, null) as IfcObject;

            IfcRelAggregates.RelatedObjects.Add(aa);
        }
Exemple #3
0
        public static BbNut Create(BbProduct bbBoltAssembly)
        {
            var bolt = new BbNut();
            bolt.AddToHostObject(bbBoltAssembly);
            BbInstanceDB.AddToExport(bolt);

            return bolt;
        }
Exemple #4
0
        public static BbWasher Create(BbProduct bbBoltAssembly)
        {
            var bolt = new BbWasher();

            bolt.AddToHostObject(bbBoltAssembly);
            BbInstanceDB.AddToExport(bolt);

            return(bolt);
        }
 public void AssignTo(BbProduct element)
 {
     //element.IfcElement.Name = Name;
     BbPropertySet.AssignTo(element);
 }
Exemple #6
0
 public void AssignTo(BbProduct element)
 {
     _ifcRelDefinesByProperties.RelatedObjects.Add(element.IfcObject);
     _elements.Add(element);
 }
 public void AssignTo(BbProduct element)
 {
     //element.IfcElement.Name = Name;
     BbPropertySet.AssignTo(element);
 }
Exemple #8
0
 public void AssignTo(BbProduct element)
 {
     _ifcRelDefinesByProperties.RelatedObjects.Add(element.IfcObject);
     _elements.Add(element);
 }