//internal constructor for creation from XbimObjectCreator internal XbimBuilding(XbimDocument document, string name, XbimSpatialStructureElement parentElement, XbimElementCompositionEnum compositionEnum) : base(document, document.Model.Instances.New<IfcBuilding>()) { Building.Name = name; Building.CompositionType = GeIfcElementCompositionEnum(compositionEnum); if (parentElement != null) parentElement.AddToSpatialDecomposition(this); if (Document.ModelView == XbimModelView.CoordinationView) { IfcLocalPlacement lp = Document.Model.Instances.New<IfcLocalPlacement>(); lp.RelativePlacement = Document.WCS; if (parentElement != null) lp.PlacementRelTo = parentElement.GetObjectPlacement(); Building.ObjectPlacement = lp; } Document.Buildings.Add(this); }
//internal constructor for creation from XbimObjectCreator internal XbimSite(XbimDocument document, string name, XbimSpatialStructureElement parentElement, XbimElementCompositionEnum compositionEnum) : base(document, document.Model.Instances.New<IfcSite>()) { Site.Name = name; Site.CompositionType = GeIfcElementCompositionEnum(compositionEnum); if (parentElement != null) parentElement.AddToSpatialDecomposition(this); //add the site to the structure of the project if there is not different parrent object if (parentElement == null) ((IfcProject)_document.Model.IfcProject).AddSite(Site); if (Document.ModelView == XbimModelView.CoordinationView) { IfcLocalPlacement lp = Document.Model.Instances.New<IfcLocalPlacement>(); lp.RelativePlacement = Document.WCS; if (parentElement != null) lp.PlacementRelTo = parentElement.GetObjectPlacement(); Site.ObjectPlacement = lp; } Document.Sites.Add(this); }