Properties and quantities
Read property sets and quantity sets by name or with the * wildcard, discover which sets a model has, and quote names that need it.
Most of what makes a model useful is not in the IFC attributes but in its property sets (psets) and quantity sets. BQL reaches both with a three-part path: the kind, the set, the name.
GET qid, attribute.Name, property.Pset_WallCommon.IsExternal
WHERE type = IFCWALL AND property.Pset_WallCommon.IsExternal = trueproperty.Pset_WallCommon.IsExternal is the IsExternal property of the Pset_WallCommon set. Booleans are written true and false; strings and numbers as in the previous lesson. The same path works in GET and in WHERE.
When you do not know the set#
Property names are far more stable than set names: IsExternal lives in Pset_WallCommon on walls, Pset_DoorCommon on doors and Pset_SlabCommon on slabs. A * in the set position matches any set, so one condition covers them all:
GET qid, type, attribute.Name WHERE property.*.IsExternal = trueThe same wildcard exists for quantities (quantity.*.NetVolume) and, in the name position, gives you every member of a set (property.Pset_WallCommon.*). property.* on its own returns all properties of an object, which is a lot of columns but the fastest way to see what an object carries. Details and the field suffixes (.value, .unit, .propertySetName) are in Properties.
Discovering what a model has#
property.meta lists the property names an object has instead of their values. Grouped and counted (the grouping lesson explains the syntax), it is a survey of the model in one query — the doors of the demo model turn out to carry 2756 different property-and-set combinations, most of them one door supplier's own sets:
GET property.meta, COUNT(qid) WHERE type = IFCDOOR GROUP BY property.metaquantity.meta does the same for quantities. Run these before you rely on a name in a model you have not seen before.
Quoting names#
A set or property name is written bare when it looks like an identifier (letters, digits, underscore). Anything else needs double quotes: the demo model's custom set eigenschappen has a property called Rc-waarde, which is property.eigenschappen."Rc-waarde", and its wapening kg/m3 is property.eigenschappen."wapening kg/m3". Quote the set name too when it contains spaces.
Quantities and units#
Quantities follow the same path with quantity. The demo model has a BaseQuantities set on its building elements with Length, Width, Height, NetSideArea, GrossVolume, NetVolume and a few more. A quantity has a unit, so a comparison can carry one: quantity.*.Height > 2.5 m is read as 2.5 metres whatever unit the model uses internally, and > 2500 mm means the same. Without a unit the number is not converted: it is compared with the value as stored, in the internal unit (millimetres for lengths) or in the model's own unit depending on how the condition runs (unit#literals), which is easy to get wrong, so write the unit. Quantities describes the quantity kinds; the units lesson at the end of this course shows how to control the units in the result.
Besides the quantities the authoring tool exported, BIM.works computes its own from the geometry: calculated.quantity.volume, calculated.quantity.floorArea on spaces, aabb.height. They exist for every object with geometry, exported quantities or not, and the calculated values lesson uses them.
Watch out for the difference between the wildcard and a set name: 443 walls of the demo model are higher than 2.5 m when you ask with quantity.*.Height, but only 439 when you ask quantity.BaseQuantities.Height — four walls keep their height in the authoring tool's own set. The wildcard is the safer question.
Your turn#
GET qid, attribute.Name WHERE type = IFCWALLHints
- The property path is property.Pset_WallCommon.IsExternal.
- Add the same path to GET to see the value in the result.
- Booleans are lowercase.
Show solution
GET qid, attribute.Name, property.Pset_WallCommon.IsExternal WHERE type = IFCWALL AND property.Pset_WallCommon.IsExternal = trueGET qid, attribute.Name, property.*.IsExternal WHERE type = IFCWALL AND property.*.IsExternal = trueThe JSON above is worth reading closely: a property leaf carries propertySetName, so the result tells you which set the value came from even when you asked with a wildcard.
GET qid, attribute.Name WHERE type = IFCWALL AND property.Pset_WallCommon.IsExternal = trueHints
- Replace the set name by *.
- The second property is called LoadBearing.
Show solution
GET qid, attribute.Name WHERE type = IFCWALL AND property.*.IsExternal = true AND property.*.LoadBearing = trueGET qid, attribute.Name WHERE type = IFCWALL AND property.*.LoadBearing = true AND property.*.IsExternal = trueGET qid, attribute.Name WHERE type = IFCWALLHints
- The quantities are called Height and NetVolume; use the * wildcard for the set.
- Write the unit in the comparison: 2.5 m.
Show solution
GET qid, attribute.Name, quantity.*.Height, quantity.*.NetVolume WHERE type = IFCWALL AND quantity.*.Height > 2.5 mGET qid, attribute.Name, quantity.*.Height, quantity.*.NetVolume WHERE type = IFCWALL AND quantity.*.Height > 2500 mmGET qid, attribute.Name WHERE type = IFCDOORHints
- A property path without a comparator means "has a value".
- NOT in front of it means the opposite.
- Use the set wildcard so the set name does not matter.
Show solution
GET qid, attribute.Name WHERE type = IFCDOOR AND NOT property.*.FireRatingGET qid, attribute.Name WHERE NOT property.*.FireRating AND type = IFCDOORYou can now#
- Read a property or quantity by set and name, in
GETand inWHERE. - Use
*when the set name is unknown or varies by type. - Survey a model with
property.metaandquantity.meta. - Quote names with spaces or punctuation.
- Compare quantities with unit literals.
Next: Relations, from an object to the objects around it.