/// <summary> /// Adds Building to the IsDecomposedBy Collection. /// </summary> public void AddBuilding(IfcBuilding building) { var decomposition = IsDecomposedBy.FirstOrDefault(); if (decomposition == null) //none defined create the relationship { var relSub = Model.Instances.New <IfcRelAggregates>(); relSub.RelatingObject = this; relSub.RelatedObjects.Add(building); } else { decomposition.RelatedObjects.Add(building); } }
/// <summary> /// Adds specified IfcSpatialStructureElement to the decomposition of this spatial structure element. /// </summary> /// <param name = "child">Child spatial structure element.</param> public void AddToSpatialDecomposition(IfcSpatialStructureElement child) { var ifcRelDecomposes = IsDecomposedBy.FirstOrDefault(); if (ifcRelDecomposes == null) //none defined create the relationship { var relSub = Model.Instances.New <IfcRelAggregates>(); relSub.RelatingObject = this; relSub.RelatedObjects.Add(child); } else { ifcRelDecomposes.RelatedObjects.Add(child); } }