Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve model_depth getter setter #3771

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions pyaedt/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2829,23 +2829,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)
return self.change_design_settings({"ModelDepth": value})

@pyaedt_function_handler()
def generate_design_data(self, linefilter=None, objectfilter=None):
Expand Down
Loading