Get FinishFloorHeight of IfcSpace using Xbim

160 views Asked by At

I'm trying to get the FinishFloorHeight of IfcSpace using Xbim.

Any idea of how to do that?

enter image description here

1

There are 1 answers

0
Martin Cerny On BEST ANSWER

If you look at the examples at xbim docs, you will see how to get data for a space. To get finish floor height as defined in your link, you can use this code:

private static double? GetFinishFloorHeight(IIfcSpace space)
{
    return space.IsDefinedBy
        .SelectMany(r => r.RelatingPropertyDefinition.PropertySetDefinitions)
        .OfType<IIfcElementQuantity>()
        .Where(qs => qs.Name == "Qto_SpaceBaseQuantities")
        .SelectMany(qset => qset.Quantities)
        .OfType<IIfcQuantityLength>()
        .Where(q => q.Name == "FinishFloorHeight")
        .FirstOrDefault()?.LengthValue;
}