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); }
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); }
public static BbNut Create(BbProduct bbBoltAssembly) { var bolt = new BbNut(); bolt.AddToHostObject(bbBoltAssembly); BbInstanceDB.AddToExport(bolt); return bolt; }
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); }
public void AssignTo(BbProduct element) { _ifcRelDefinesByProperties.RelatedObjects.Add(element.IfcObject); _elements.Add(element); }