diff --git a/jupytercad_freecad/freecad/loader.py b/jupytercad_freecad/freecad/loader.py index b184237..02f2eaf 100644 --- a/jupytercad_freecad/freecad/loader.py +++ b/jupytercad_freecad/freecad/loader.py @@ -12,6 +12,11 @@ logger = logging.getLogger(__file__) +from jupytercad_core.schema.interfaces.jcad import Parts + +SUPPORTED_TYPES = [part.value for part in list(Parts)] + + with redirect_stdout_stderr(): try: import freecad as fc @@ -244,6 +249,9 @@ def _fc_to_jcad_obj(self, obj) -> Dict: name=obj.Name, ) for prop in obj.PropertiesList: + # Do not load Shape entry if we support that type in JupyterCAD + if prop == "Shape" and obj.TypeId in SUPPORTED_TYPES: + continue prop_type = obj.getTypeIdOfProperty(prop) prop_value = getattr(obj, prop) prop_handler = self._prop_handlers.get(prop_type, None)