diff --git a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py index f2c7dd8f11..21ef97ac65 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py @@ -225,7 +225,10 @@ def serialize_shape(shape): shapes.SetFormatNb(2) shapes.Add(shape) - return shapes.WriteToString() + if hasattr(shapes, "WriteToString"): + return shapes.WriteToString() + else: + return shapes.Write() def create_shape_from_serialization(