diff --git a/pyaedt/modeler/modeler3d.py b/pyaedt/modeler/modeler3d.py index 7b1359ee2b8..a7785a9225a 100644 --- a/pyaedt/modeler/modeler3d.py +++ b/pyaedt/modeler/modeler3d.py @@ -215,7 +215,7 @@ def create_3dcomponent( else: native_objs = [obj.name for _, v in self.user_defined_components.items() for _, obj in v.parts.items()] objs = [obj for obj in self.object_names if obj not in native_objs] - if not native_components and native_objs: + if not native_components and native_objs and not auxiliary_dict: self.logger.warning( "Native component objects cannot be exported. Use native_components argument to" " export an auxiliary dictionary file containing 3D components information" diff --git a/pyaedt/modules/MeshIcepak.py b/pyaedt/modules/MeshIcepak.py index 985df51ee86..4091f62429b 100644 --- a/pyaedt/modules/MeshIcepak.py +++ b/pyaedt/modules/MeshIcepak.py @@ -1067,8 +1067,13 @@ def _get_design_mesh_operations(self): "Icepak", ) ) - except Exception as e: - self._app.logger.error(e) + except TypeError: + # design_properties not loaded, maybe there are mesh region, we need to warn the user + self._app.logger.warning("No mesh operation found.") + self._app.logger.debug("Failed to get mesh operation from `design_properties`.") + except KeyError: + # design_properties loaded, mesh region related keys missing, no need to warn the user + self._app.logger.debug("Failed to get mesh operation.") return meshops @@ -1104,8 +1109,13 @@ def _get_design_mesh_regions(self): if el in meshop.__dict__: meshop.__dict__[el] = dict_prop[el] meshops.append(meshop) - except Exception as e: - self._app.logger.error(e) + except TypeError: + # design_properties not loaded, maybe there are mesh region, we need to warn the user + self._app.logger.warning("No mesh region found.") + self._app.logger.debug("Failed to get mesh region from `design_properties`.") + except KeyError: + # design_properties loaded, mesh region related keys missing, no need to warn the user + self._app.logger.debug("Failed to get mesh region.") return meshops