SpatialElementBoundaryOptions sebOptions = new SpatialElementBoundaryOptions
{
SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish
};
SpatialElementGeometryCalculator calc = new SpatialElementGeometryCalculator(document, sebOptions);
SpatialElementGeometryResults results = calc.CalculateSpatialElementGeometry(room);
Solid roomSolid = results.GetGeometry();
var getbb = roomSolid.GetBoundingBox();
var maxZ = getbb.Max.Z;
var minZ = getbb.Min.Z;
var height = maxZ - minZ