diff --git a/examples/07-Circuit/Virtual_Compliance.py b/examples/07-Circuit/Virtual_Compliance.py index 9ba6d67d4c0..dc2aad6d3ff 100644 --- a/examples/07-Circuit/Virtual_Compliance.py +++ b/examples/07-Circuit/Virtual_Compliance.py @@ -12,7 +12,7 @@ import os.path import ansys.aedt.core -from ansys.aedt.core.post.compliance import VirtualCompliance +from ansys.aedt.core.visualization.post.compliance import VirtualCompliance ########################################################## # Set AEDT version diff --git a/src/ansys/aedt/core/application/analysis_3d.py b/src/ansys/aedt/core/application/analysis_3d.py index 322acfa218a..b0d82e54948 100644 --- a/src/ansys/aedt/core/application/analysis_3d.py +++ b/src/ansys/aedt/core/application/analysis_3d.py @@ -491,9 +491,11 @@ def copy_solid_bodies_from(self, design, assignment=None, no_vacuum=True, no_pec or original_design_type == dest_design_type ): new_udc_list.append(udc) - for part_id in design.modeler.user_defined_components[udc].parts: - if design.modeler.user_defined_components[udc].parts[part_id].name in body_list: - body_list.remove(design.modeler.user_defined_components[udc].parts[part_id].name) + parts = design.modeler.user_defined_components[udc].parts + for part_id in parts: + part_name = parts[part_id].name + if part_name in body_list: + body_list.remove(part_name) selection_list = [] udc_selection = [] @@ -1087,10 +1089,12 @@ def flatten_3d_components(self, components=None, purge_history=True, password=No """ if password is None: password = os.getenv("PYAEDT_ENCRYPTED_PASSWORD", "") - native_comp_names = [nc for nc in self.native_components.keys()] + native_comp_names = [nc.definition_name for nc in self.native_components.values()] if not components: components = [ - key for key, val in self.modeler.user_defined_components.items() if val.name not in native_comp_names + key + for key, val in self.modeler.user_defined_components.items() + if val.definition_name not in native_comp_names ] else: if isinstance(components, str): @@ -1101,6 +1105,7 @@ def flatten_3d_components(self, components=None, purge_history=True, password=No for cmp in components: comp = self.modeler.user_defined_components[cmp] + # TODO: Call edit_definition only once target_cs = self.modeler._create_reference_cs_from_3dcomp(comp, password=password) app = comp.edit_definition(password=password) for var, val in comp.parameters.items(): @@ -1110,7 +1115,8 @@ def flatten_3d_components(self, components=None, purge_history=True, password=No monitor_cache = {} if self.design_type == "Icepak": objs_monitors = [part.name for _, part in comp.parts.items()] - for mon_name, mon_obj in self.monitor.all_monitors.items(): + all_monitors = self.monitor.all_monitors.items() + for _, mon_obj in all_monitors: obj_name = mon_obj.properties["Geometry Assignment"] if obj_name in objs_monitors: monitor_cache.update({mon_obj.name: mon_obj.properties}) @@ -1147,7 +1153,7 @@ def flatten_3d_components(self, components=None, purge_history=True, password=No m_type, m_obj, dict_in["monitor"][monitor_obj]["Quantity"], monitor_obj ): # pragma: no cover return False - app.oproject.Close() + app.close_project() if not self.design_type == "Icepak": self.mesh._refresh_mesh_operations() diff --git a/src/ansys/aedt/core/circuit.py b/src/ansys/aedt/core/circuit.py index 946a892ca56..47aa0d6b6f5 100644 --- a/src/ansys/aedt/core/circuit.py +++ b/src/ansys/aedt/core/circuit.py @@ -1610,7 +1610,7 @@ def connect_circuit_models_from_multi_zone_cutout( except Exception: print("failed to get pin2") if pin1 and pin2: - pin1.connect_to_component(component_pin=pin2, use_wire=False) + pin1.connect_to_component(assignment=pin2, use_wire=False) for model_name, ports in ports.items(): if any(cmp for cmp in list(self.modeler.schematic.components.values()) if model_name in cmp.name): model = next( diff --git a/src/ansys/aedt/core/generic/configurations.py b/src/ansys/aedt/core/generic/configurations.py index a26f1d41dbc..776578e28d0 100644 --- a/src/ansys/aedt/core/generic/configurations.py +++ b/src/ansys/aedt/core/generic/configurations.py @@ -2059,7 +2059,7 @@ def apply_operations_to_native_components(obj, operation_dict, native_dict): # vector_list = [decompose_variable_value(operation_dict["Props"]["Vector"][i])[0] for i in range(3)] new_objs = obj.duplicate_along_line( vector_list, - nclones=operation_dict["Props"]["Total Number"], + clones=operation_dict["Props"]["Total Number"], attach_object=operation_dict["Props"]["Attach To Original Object"], ) elif operation_dict["Props"]["Command"] == "DuplicateAroundAxis": diff --git a/src/ansys/aedt/core/modeler/advanced_cad/parts.py b/src/ansys/aedt/core/modeler/advanced_cad/parts.py index 8078b49fc2a..dd6e4b1dbc2 100644 --- a/src/ansys/aedt/core/modeler/advanced_cad/parts.py +++ b/src/ansys/aedt/core/modeler/advanced_cad/parts.py @@ -449,7 +449,7 @@ def insert(self, app): if self["duplicate_vector"]: d_vect = [float(i) for i in self["duplicate_vector"]] duplicate_result = app.modeler.duplicate_along_line( - aedt_objects[0], d_vect, nclones=int(self["duplicate_number"]), is_3d_comp=True + aedt_objects[0], d_vect, clones=int(self["duplicate_number"]), is_3d_comp=True ) if duplicate_result[0]: for d in duplicate_result[1]: diff --git a/src/ansys/aedt/core/modeler/cad/components_3d.py b/src/ansys/aedt/core/modeler/cad/components_3d.py index 32fb372aa9b..a3eb7b1139a 100644 --- a/src/ansys/aedt/core/modeler/cad/components_3d.py +++ b/src/ansys/aedt/core/modeler/cad/components_3d.py @@ -890,11 +890,10 @@ def edit_definition(self, password=None): """ # TODO: Edit documentation to include all supported returned classes. - from ansys.aedt.core.generic.design_types import get_pyaedt_app - # from ansys.aedt.core.generic.general_methods import is_linux if password is None: password = os.getenv("PYAEDT_ENCRYPTED_PASSWORD", "") + project_list = [i for i in self._primitives._app.project_list] self._primitives.oeditor.Edit3DComponentDefinition( @@ -907,6 +906,8 @@ def edit_definition(self, password=None): new_project = [i for i in self._primitives._app.project_list if i not in project_list] if new_project: + from ansys.aedt.core.generic.design_types import get_pyaedt_app + project = self._primitives._app.desktop_class.active_project(new_project[0]) # project = self._primitives._app.odesktop.GetActiveProject() project_name = project.GetName() diff --git a/src/ansys/aedt/core/modeler/cad/primitives_3d.py b/src/ansys/aedt/core/modeler/cad/primitives_3d.py index 9f022fa6598..c1b79ed959c 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives_3d.py +++ b/src/ansys/aedt/core/modeler/cad/primitives_3d.py @@ -1461,7 +1461,7 @@ def _create_reference_cs_from_3dcomp(self, assignment, password): ) return cs_name else: - app.oproject.Close() + app.close_project() return assignment.target_coordinate_system @staticmethod diff --git a/src/ansys/aedt/core/visualization/plot/pyvista.py b/src/ansys/aedt/core/visualization/plot/pyvista.py index d942f724a14..ecc2de28a3a 100644 --- a/src/ansys/aedt/core/visualization/plot/pyvista.py +++ b/src/ansys/aedt/core/visualization/plot/pyvista.py @@ -1540,8 +1540,9 @@ def p_callback(): break i = 0 first_loop = False - scalars = self.frames[i]._cached_polydata.point_data[self.frames[i].scalar_name] - self.pv.update_scalars(scalars, render=False) + mesh_i = self.frames[i]._cached_polydata + scalars = mesh_i.point_data[self.frames[i].scalar_name] + mesh_i.point_data[self.frames[i].scalar_name] = scalars if not hasattr(self.pv, "ren_win"): break time.sleep(max(0, (1 / self.frame_per_seconds) - (time.time() - start))) diff --git a/src/ansys/aedt/core/visualization/post/common.py b/src/ansys/aedt/core/visualization/post/common.py index 374fef3f469..22dda32715b 100644 --- a/src/ansys/aedt/core/visualization/post/common.py +++ b/src/ansys/aedt/core/visualization/post/common.py @@ -1663,8 +1663,17 @@ def create_report_from_configuration(self, input_file=None, report_settings=None else: report_temp = TEMPLATES_BY_NAME[props["report_category"]] report = report_temp(self, props["report_category"], solution_name) - for k, v in props.items(): - report._props[k] = v + + def _update_props(prop_in, props_out): + for k, v in prop_in.items(): + if isinstance(v, dict): + if k not in props_out: + props_out[k] = {} + _update_props(v, props_out[k]) + else: + props_out[k] = v + + _update_props(props, report._props) for el, k in self._app.available_variations.nominal_w_values_dict.items(): if ( report._props.get("context", None) diff --git a/src/ansys/aedt/core/visualization/report/eye.py b/src/ansys/aedt/core/visualization/report/eye.py index 716ca521b2d..5346913f059 100644 --- a/src/ansys/aedt/core/visualization/report/eye.py +++ b/src/ansys/aedt/core/visualization/report/eye.py @@ -43,9 +43,11 @@ def __init__(self, app, report_category, setup_name, expressions=None): self.domain = "Time" self._props["report_type"] = "Rectangular Contour Plot" self.variations.pop("Time", None) - self._props["context"]["variations"]["__UnitInterval"] = "All" - self._props["context"]["variations"]["__Amplitude"] = "All" - self._props["context"]["variations"]["__EyeOpening"] = "0" + self._props["context"]["variations"]["__UnitInterval"] = ["All"] + self._props["context"]["variations"]["__Amplitude"] = ["All"] + self._props["context"]["variations"]["__EyeOpening"] = ["0"] + self._props["context"]["primary_sweep"] = "__UnitInterval" + self._props["context"]["secondary_sweep"] = "__Amplitude" self.quantity_type = 0 self.min_latch_overlay = "0" self.noise_floor = "1e-16"