Calculated values
Use the quantities, bounding boxes and consistency flags BIM.works derives from the geometry itself, and compare them with what the authoring tool exported.
Everything you have queried so far was in the file: an attribute, a property, a quantity somebody exported. BIM.works also computes values from the geometry of each object, and those exist whether the authoring tool wrote them or not. They live under calculated. and under aabb..
calculated.quantity#
The derived quantities are volumes, areas, perimeters — one path per quantity, no set name, because BIM.works computes them itself:
GET qid, attribute.LongName, calculated.quantity.floorArea UNIT m2, calculated.quantity.volume UNIT m3
WHERE type = IFCSPACEfloorArea is the floor area of a space or a horizontal element, volume the volume of the object's geometry, perimeter the perimeter of its footprint, area its total surface area. They are computed from the same geometry the viewer draws, so a space whose boundaries do not close gets no value rather than a wrong one. The full list is on Calculated values.
The bounding box#
aabb is the axis-aligned bounding box of the object, in model coordinates: aabb.width, aabb.depth, aabb.height, and the six sides aabb.minx, aabb.maxx, aabb.miny, aabb.maxy, aabb.minz, aabb.maxz. It is the cheapest way to ask a geometric question, and it needs no property to be present:
GET qid, attribute.Name, aabb.height WHERE type = IFCDOOR ORDER BY aabb.height DESC LIMIT 5 USING LENGTH_UNIT = mA bounding box is not the object: a diagonal beam has a box far larger than itself. When that matters, the oriented box (calculated.obb.*) and the spatial predicates of Spatial and advanced are the tools.
Comparing the file with the geometry#
Because both the exported and the computed quantity are queryable, one condition compares them — which is how a model is checked for quantities that no longer match the shapes:
GET qid, attribute.Name, quantity.*.NetVolume, calculated.quantity.volume
WHERE type = IFCWALL AND quantity.*.NetVolume != calculated.quantity.volume WITHIN 2 %
USING VOLUME_UNIT = m3WITHIN turns an exact comparison into a tolerant one: = … WITHIN 2 % is "equal to within two per cent", and with != in front it selects the objects that differ by more than that. A tolerance may also be absolute (WITHIN 0.05 m3). Arithmetic works on both sides, so ABS(a - b) and a > b * 1.1 are conditions too (where#within).
On Schependomlaan that query returns nothing, which is the answer you want: all 877 walls that carry a NetVolume agree with their geometry to within one per cent. Run it on a model that has been edited by hand for a while and it stops being empty.
calculated.consistency.watertight, .manifold and .bwOpenEdges describe the mesh itself, and calculated.geometry.counts.triangles how heavy it is. They are the fastest way to find the objects that will give a viewer or an export trouble: 602 objects of the demo model are not watertight, 64 of them walls.
Your turn#
GET qid, attribute.LongName WHERE type = IFCSPACEHints
- The path is calculated.quantity.floorArea; there is no set name.
- UNIT m2 converts the column to square metres.
Show solution
GET qid, attribute.LongName, calculated.quantity.floorArea UNIT m2 WHERE type = IFCSPACEGET qid, attribute.LongName, calculated.quantity.floorArea WHERE type = IFCSPACE USING AREA_UNIT = m2GET qid, attribute.Name, aabb.height WHERE type = IFCDOORHints
- The height of the bounding box is aabb.height.
- ORDER BY … DESC sorts from large to small, and LIMIT cuts the sorted result.
- USING LENGTH_UNIT = m converts the height to metres.
Show solution
GET qid, attribute.Name, aabb.height WHERE type = IFCDOOR ORDER BY aabb.height DESC LIMIT 5 USING LENGTH_UNIT = mGET qid, aabb.height, attribute.Name WHERE type = IFCDOOR ORDER BY aabb.height DESC LIMIT 5 USING LENGTH_UNIT = mFive doors, coloured in the model: with the view framed on them you can see at once that the highest "doors" of this model are frames — stelkozijn, 2.82 m — and not the front door.
GET qid, attribute.Name WHERE type = IFCWALLHints
- The flag is calculated.consistency.watertight.
- It is a boolean, so compare it with false.
Show solution
GET qid, attribute.Name WHERE type = IFCWALL AND calculated.consistency.watertight = falseGET qid, attribute.Name WHERE calculated.consistency.watertight = false AND type = IFCWALL64 of the 934 walls have a mesh with holes in it. That is the query to run before you blame a viewer or an export for a wall that looks wrong: the geometry was already open in the file.
You can now#
- Read the quantities BIM.works derives from the geometry, whatever the file contains.
- Use the bounding box of an object in
GET, inWHEREand as a sort key. - Compare two features with each other, with a tolerance.
Next: Surveying a model, the queries you run on a model you have never seen.