Surveying a model
Find out what a model you have never seen contains — its classes, its property and quantity sets, its materials and classifications, and the objects whose geometry will give trouble.
Every query so far assumed you knew what to ask for: that walls carry Pset_WallCommon, that the quantity set is called BaseQuantities, that the storeys have those Dutch names. On a model somebody has just sent you, none of that is given. This lesson is the survey you run first — five queries that tell you what is in the file before you write anything that depends on it.
What is in it#
The one query to remember, from the grouping lesson, with a sample object per class:
GET type, COUNT(qid), FIRST(qid) GROUP BY type39 classes in the demo model, IfcBeam 174 objects, IfcWall 652, IfcWallStandardCase 282, and so on. FIRST(qid) gives one deterministic member of each group, which is what you paste into the viewer to see what such an object actually looks like.
Which properties and quantities exist#
property.meta and quantity.meta return the names an object carries instead of their values, so grouping on them lists the vocabulary of the model:
GET property.meta, COUNT(qid) WHERE type = IFCSPACE GROUP BY property.metaEach row is one set-and-property combination with the number of objects that have it: 217 of them on the spaces of the demo model, from Pset_SpaceCommon to the authoring tool's AC_Pset_Zone_Stempel_18_KM. The doors are worse: 2756 property combinations and 1371 quantity combinations, most of them one door supplier's own sets. This is the query that tells you whether a check is even possible on a model, and under which name.
Materials, classifications and the header#
Three more questions worth asking, all from the earlier lessons:
GET material.name, COUNT(qid) WHERE type = IFCWALL GROUP BY material.nameGET classification.identity, COUNT(qid) WHERE type = IFCWALL GROUP BY classification.identityThe first shows which materials the walls are made of — twenty of them, from 01 Hout - hardhout (51 walls) to the cavity-wall leaves in 03 Metselwerk - kalkzandsteen C — the second which NL-SfB codes they carry (423 walls are 21.12). model.name, model.ifcVersion and the model.header.* features say what the file itself claims to be — IFC2X3_TC1 for Schependomlaan (Model).
What will give trouble#
The geometry the model came with is not always sound, and the objects that are unsound are the ones that will look wrong in a viewer, take too long to render or fail an export:
GET qid, type, attribute.Name WHERE calculated.consistency.watertight = false602 objects of the demo model, in fourteen classes. Worth knowing before you promise anybody a clean export.
The other half of surveying is spatial: which objects clash, what sits inside a space, how close two things are. Those constructs (CLASHES_WITH, geometry:contained_in, geometry:clearance) are on Spatial and advanced; they need clash detection and spatial querying enabled on the instance, and on this instance they answer nothing for the demo model, so this course leaves them to the reference.
Your turn#
GET type, COUNT(qid) GROUP BY typeHints
- FIRST(qid) returns one member of the group.
- It is a third GET item, next to the key and the count.
Show solution
GET type, COUNT(qid), FIRST(qid) GROUP BY typeGET type AS Class, COUNT(qid) AS Objects, FIRST(qid) AS Sample GROUP BY typeGET property.meta WHERE type = IFCSPACEHints
- property.meta is a feature like any other, so it can be a group key.
- The count is COUNT(qid), as always.
Show solution
GET property.meta, COUNT(qid) WHERE type = IFCSPACE GROUP BY property.metaGET property.meta AS Property, COUNT(qid) AS Spaces WHERE type = IFCSPACE GROUP BY property.metaGET qid, attribute.Name WHERE type = IFCWALLHints
- The relation is classification, and the field is identity.
- It works in WHERE as well as in GET, and the value is a string.
Show solution
GET qid, attribute.Name, classification.identity WHERE type = IFCWALL AND classification.identity = "21.12"GET qid, classification.identity, attribute.Name WHERE type = IFCWALL AND classification.identity = "21.12"Coloured in the viewer, a classification code stops being a string in a table: you see which walls of the building carry it, and whether the modeller was consistent about it.
You can now#
- Ask an unknown model what classes, properties, quantities, materials and classifications it has.
- Read a sample object per group with
FIRST. - Find the objects whose geometry is not sound before they cause trouble.
Next: From query to IFC, where the result leaves BIM.works as a file.