diff --git a/pyaedt/maxwell.py b/pyaedt/maxwell.py index 82d1971c36b..67acc669ebe 100644 --- a/pyaedt/maxwell.py +++ b/pyaedt/maxwell.py @@ -10,7 +10,6 @@ from pyaedt.application.Analysis3D import FieldAnalysis3D from pyaedt.application.Variables import decompose_variable_value -from pyaedt.generic.DataHandlers import float_units from pyaedt.generic.constants import SOLUTIONS from pyaedt.generic.general_methods import generate_unique_name from pyaedt.generic.general_methods import open_file @@ -2829,23 +2828,19 @@ def xy_plane(self, value=True): @property def model_depth(self): """Model depth.""" - - if "ModelDepth" in self.design_properties: - value_str = self.design_properties["ModelDepth"] - a = None - try: - a = float_units(value_str) - except: - a = self.variable_manager[value_str].value - finally: - return a + design_settings = self.design_settings() + if "ModelDepth" in design_settings: + value_str = design_settings["ModelDepth"] + return value_str else: return None @model_depth.setter def model_depth(self, value): """Set model depth.""" - return self.change_design_settings({"ModelDepth": self.modeler._arg_with_dim(value, self.modeler.model_units)}) + if isinstance(value, float) or isinstance(value, int): + value = self.modeler._arg_with_dim(value, self.modeler.model_units) + self.change_design_settings({"ModelDepth": value}) @pyaedt_function_handler() def generate_design_data(self, linefilter=None, objectfilter=None):