From 5af975f99e4e80773acd5c8bda0a0b49fd36a33b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 15 Nov 2023 13:42:55 +0100 Subject: [PATCH] Backwards compatibility for py setting strings --- src/ifcopenshell-python/ifcopenshell/geom/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 551f331972..55d5538a0c 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -97,6 +97,12 @@ class settings_mixin: def get(self, k): return self.get_(self.name(k)) + def __getattr__(self, k): + if k in map(self.rname, self.setting_names()): + return k + else: + raise AttributeError("'Settings' object has no attribute '%s'" % k) + class serializer_settings(settings_mixin, ifcopenshell_wrapper.SerializerSettings): pass