From f3dedba3203bd3aa9085aeca72c6113596786e5f Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 19 Sep 2025 13:23:29 +0200 Subject: [PATCH] Map opt in taxonony to none,false,true --- src/ifcwrap/IfcGeomWrapper.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 9023cdf828..bc64a69bb0 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -112,6 +112,14 @@ std::pair vector_to_buffer(const T& t) { } } +%typemap(out) boost::optional { + if ($1) { + $result = PyBool_FromLong(*$1 ? 1 : 0); + } else { + Py_INCREF(Py_None); + $result = Py_None; + } +} %typemap(in) ifcopenshell::geometry::taxonomy::item::ptr { // @this is really annoying, but apparently inheritance