0

I am quite new to xBim and I am struggeling to find the information I need. I have been able to iterate through all the IFCSpaces for each storey, and I would like to find each space's IfcPolyline so that I will know its boundaries. But how?

    using (IfcStore model = IfcStore.Open(filename, null))
    {
        List<IfcBuildingStorey> allstories = model.Instances.OfType<IfcBuildingStorey>().ToList();

        for (int i=0;i<allstories.Count;i++)
        {
            IfcBuildingStorey storey = allstories[i];
            var spaces = storey.Spaces.ToList();
            for (int j=0;j<spaces.Count;j++)
            {
                var space = spaces[j];
                var spaceBoundaries=space.BoundedBy.ToList();
                for (int u=0;u<spaceBoundaries.Count;u++)
                {
                   //IfcPolyline from here??
                }
            }
        }
    }
sinsro
  • 192
  • 1
  • 10

1 Answers1

2

This is quite old question, but in case you are still looking for the answer: IfcSpace.BoundedBy is an inverse relation and will give you a list of IfcRelSpaceBoundaries. This has RelatedBuildingElement attribute which will give you bounding building element such as a wall, door etc. It also has ConnectionGeometry, which is essentially an interface as the geometry of this connection might be curve, point, surface or volume. If you drill further down in the object model, you will see that the boundary can be any kind of curve, not just a polyline.

Entirely different approach could be to access the space geometry Space.Representation. This could have a 2D representation which would likely be a polygon, or it might be a 3D extrusion with profile. That would again be what you are looking for. But be aware, that it can be any other kind of geometry representation depending on the authoring software and model author.

Martin Cerny
  • 344
  • 3
  • 9