diff --git a/src/ansys/aedt/core/modules/boundary/common.py b/src/ansys/aedt/core/modules/boundary/common.py index 9bb6c2bc9cf..74596de741b 100644 --- a/src/ansys/aedt/core/modules/boundary/common.py +++ b/src/ansys/aedt/core/modules/boundary/common.py @@ -96,6 +96,8 @@ def _get_args(self, props=None): def _initialize_bynary_tree(self): if self._child_object: BinaryTreeNode.__init__(self, self._name, self._child_object, False) + return True + return False @pyaedt_function_handler() def delete(self): @@ -324,7 +326,7 @@ def type(self, value): def name(self): """Boundary Name.""" if self._child_object: - self._name = self.properties["Name"] + self._name = str(self.properties["Name"]) return self._name @name.setter @@ -523,10 +525,12 @@ def create(self): ) elif bound_type == "SBRTxRxSettings": self._app.oboundary.SetSBRTxRxSettings(self._get_args()) + return True elif bound_type == "EndConnection": self._app.oboundary.AssignEndConnection(self._get_args()) elif bound_type == "Hybrid": self._app.oboundary.AssignHybridRegion(self._get_args()) + return True elif bound_type == "FluxTangential": self._app.oboundary.AssignFluxTangential(self._get_args()) elif bound_type == "Plane Incident Wave": @@ -536,9 +540,7 @@ def create(self): else: return False - self._initialize_bynary_tree() - - return True + return self._initialize_bynary_tree() @pyaedt_function_handler() def update(self): diff --git a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py index eec74a73450..3932aec0fd3 100644 --- a/src/ansys/aedt/core/modules/boundary/hfss_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/hfss_boundary.py @@ -95,7 +95,7 @@ def props(self): def name(self): """Boundary Name.""" if self._child_object: - self._name = self.properties["Name"] + self._name = str(self.properties["Name"]) return self._name @name.setter @@ -138,8 +138,7 @@ def create(self): self._app.oradfield.AddAntennaOverlay(self._get_args()) elif self.type == "FieldSourceGroup": self._app.oradfield.AddRadFieldSourceGroup(self._get_args()) - self._initialize_bynary_tree() - return True + return self._initialize_bynary_tree() @pyaedt_function_handler() def update(self): diff --git a/src/ansys/aedt/core/modules/boundary/layout_boundary.py b/src/ansys/aedt/core/modules/boundary/layout_boundary.py index cf8f8de4987..18a77b1fa40 100644 --- a/src/ansys/aedt/core/modules/boundary/layout_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/layout_boundary.py @@ -133,7 +133,7 @@ def props(self): def name(self): """Boundary Name.""" if self._child_object: - self._name = self.properties["Name"] + self._name = str(self.properties["Name"]) return self._name @name.setter @@ -218,8 +218,7 @@ def create(self): self.excitation_name = a[0].split(":")[0] except (GrpcApiError, IndexError): self.excitation_name = self._name - self._initialize_bynary_tree() - return True + return self._initialize_bynary_tree() @pyaedt_function_handler() def update(self): diff --git a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py index e7fb6013269..b21f8c8697b 100644 --- a/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py +++ b/src/ansys/aedt/core/modules/boundary/maxwell_boundary.py @@ -125,7 +125,7 @@ def props(self): def name(self): """Boundary Name.""" if self._child_object: - self._name = self.properties["Name"] + self._name = str(self.properties["Name"]) return self._name @name.setter @@ -177,8 +177,7 @@ def create(self): self._app.o_maxwell_parameters.AssignLayoutForce(self._get_args()) else: return False - self._initialize_bynary_tree() - return True + return self._initialize_bynary_tree() @pyaedt_function_handler() def update(self): diff --git a/src/ansys/aedt/core/modules/mesh.py b/src/ansys/aedt/core/modules/mesh.py index d95d5b4d9c0..7c5fbcf5772 100644 --- a/src/ansys/aedt/core/modules/mesh.py +++ b/src/ansys/aedt/core/modules/mesh.py @@ -212,7 +212,7 @@ def name(self): """ if self._child_object: - self._name = self.properties["Name"] + self._name = str(self.properties["Name"]) return self._name @name.setter @@ -259,8 +259,7 @@ def create(self): self._mesh.omeshmodule.AssignCylindricalGapOp(self._get_args()) else: return False - self._initialize_bynary_tree() - return True + return self._initialize_bynary_tree() @pyaedt_function_handler() def update(self, key_name=None, value=None): @@ -409,6 +408,8 @@ def delete(self): def _initialize_bynary_tree(self): if self._child_object: BinaryTreeNode.__init__(self, self._name, self._child_object, False) + return True + return False class Mesh(object): diff --git a/src/ansys/aedt/core/modules/solve_setup.py b/src/ansys/aedt/core/modules/solve_setup.py index 584c7fa3027..f27e155f0e3 100644 --- a/src/ansys/aedt/core/modules/solve_setup.py +++ b/src/ansys/aedt/core/modules/solve_setup.py @@ -97,6 +97,8 @@ def _child_object(self): def _initialize_bynary_tree(self): if self._child_object: BinaryTreeNode.__init__(self, self._name, self._child_object, False) + return True + return False @property def sweeps(self): @@ -556,8 +558,8 @@ def create(self): Returns ------- - dict - Dictionary of arguments. + bool + Result of operation. References ---------- @@ -567,8 +569,7 @@ def create(self): arg = ["NAME:" + self._name] _dict2arg(self.props, arg) self.omodule.InsertSetup(soltype, arg) - self._initialize_bynary_tree() - return arg + return self._initialize_bynary_tree() @pyaedt_function_handler(update_dictionary="properties") def update(self, properties=None): @@ -1155,8 +1156,8 @@ def create(self): Returns ------- - dict - Dictionary of the arguments. + bool + Result of operation. References ---------- @@ -1171,8 +1172,7 @@ def create(self): arg = ["NAME:SimSetup"] _dict2arg(self.props, arg) self._setup(soltype, arg) - self._initialize_bynary_tree() - return arg + return self._initialize_bynary_tree() @pyaedt_function_handler() def _setup(self, soltype, arg, newsetup=True): @@ -1913,8 +1913,7 @@ def create(self): arg = ["NAME:" + self.name] _dict2arg(self.props, arg) self.omodule.Add(arg) - self._initialize_bynary_tree() - return True + return self._initialize_bynary_tree() @pyaedt_function_handler(update_dictionary="properties") def update(self, properties=None): diff --git a/tests/system/general/test_01_configuration_files.py b/tests/system/general/test_01_configuration_files.py index 05168479c8e..27045e04704 100644 --- a/tests/system/general/test_01_configuration_files.py +++ b/tests/system/general/test_01_configuration_files.py @@ -97,6 +97,7 @@ def hfss3dl_b(add_app): class TestClass: def test_01_hfss_export(self, aedtapp, add_app): aedtapp.mesh.assign_length_mesh("sub") + aedtapp.boundaries[-1].props conf_file = aedtapp.configurations.export_config() assert aedtapp.configurations.validate(conf_file) filename = aedtapp.design_name