From 481becfc05fe4917c696f98648d28da42b0a29fe Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Sun, 30 Aug 2026 15:43:55 +0300 Subject: [PATCH] ifcwrap: keep the derived marker when None is assigned to a derived attribute set_attribute_value_py turned every Python None into blank{}, so createIfcSIUnit(None, ...) stored a null in the derived Dimensions slot. The STEP output still shows "*" and the Python accessor still resolves the value, but validate() reads the raw slot and reports "Attribute is derived in subtype" for every such instance. 0.8.5 accepted the same call and kept the derived marker. Mirror populate_derived_() and store derived{} when the target slot is derived. --- src/ifcwrap/IfcParseWrapper.i | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 63f5fc8ba6..261f3c9da9 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -623,6 +623,12 @@ private: // @nb we don't check anymore if the attribute is optional here, because it should be // possible to go back to the state at construction time. // bool is_optional = $self->declaration().as_entity()->attribute_by_index(i)->optional(); + // A derived attribute keeps its derived marker, as at construction time. + auto* ent = $self->declaration().as_entity(); + if (ent && i < ent->derived().size() && ent->derived()[i]) { + self->set_attribute_value(i, ifcopenshell::derived{}); + return; + } self->set_attribute_value(i, blank{}); return; }