Expand description
Plain host values written by name, coerced against the declared type (#342).
A tagged value says exactly what it is: Text or Enum, Integer or
Real, IFCLABEL('x') or 'x'. A host’s plain value does not: Python’s
"STANDARD" could be either of the first pair, 1 either of the second.
IfcModel::set_attribute_by_name_plain settles it from the attribute’s
declared EXPRESS type in the release the header declares
(ifc::attribute_type), and refuses what the declaration cannot settle.
§The rules
| Plain value | Declared type | Written |
|---|---|---|
| any | through a defined type | as for the type it aliases, bare: IfcLabel takes 'x' |
| string | STRING | text |
| string | an enumeration | the item it names (any case), else type-mismatch |
| integer | INTEGER, NUMBER | integer |
| integer | REAL | real, when exact (within 2^53), else type-mismatch |
| float | REAL, NUMBER | real |
| bool | BOOLEAN, LOGICAL | .T. / .F. |
| list | an aggregate | each element coerced against the element type |
| entity handle | an entity | a reference, when the target exists (missing-reference) and is of the type or a subtype (type-mismatch) |
| entity handle | a SELECT | a reference, when an entity member accepts the target |
| other | a SELECT | the one member that accepts it, as a typed parameter (IFCLABEL('x')); several: ambiguous-value, naming them |
| null | any | $ |
Anything else is type-mismatch: a float for an INTEGER, a string for
a REAL, any plain value for BINARY (write a binary explicitly). A
declared type the tables do not resolve is unsupported. Typed
parameters appear only in a SELECT, as ISO 10303-21 §12.1.8 writes them;
everywhere else the value is bare (§12.1.6, §12.1.7).
Plain::Exact carries a tagged value through unchanged, nested in a
list too, so a caller keeps exact control where it wants it.
Enums§
- Plain
- A host value before coercion: what a host language holds without saying which IFC type it means.