diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 5c3fbe55..91e94c50 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -719,11 +719,11 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return shape; }, py::arg("name"), "sets 'name' property to all solids of shape") - .def_property("name", [](const TopoDS_Shape & self) { + .def_property("name", [](const TopoDS_Shape & self) -> optional { if (auto name = OCCGeometry::global_shape_properties[self.TShape()].name) return *name; else - return string(); + return nullopt; }, [](const TopoDS_Shape & self, optional name) { OCCGeometry::global_shape_properties[self.TShape()].name = name; }, "'name' of shape")