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

FEAT: improve edit_external_circuit #4696

Merged
merged 8 commits into from
May 23, 2024
Merged
Changes from all commits
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
23 changes: 18 additions & 5 deletions pyaedt/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,17 +1920,24 @@ def export_element_based_harmonic_force(
self.odesign.ExportElementBasedHarmonicForce(output_directory, setup, freq_option, f1, f2)
return output_directory

@pyaedt_function_handler
def edit_external_circuit(self, netlist_file_path, schematic_design_name):
@pyaedt_function_handler()
def edit_external_circuit(self, netlist_file_path, schematic_design_name, parameters=None):
"""
Edit the external circuit for the winding.
Edit the external circuit for the winding and allow editing of the circuit parameters.

Parameters
----------
netlist_file_path : str
Circuit netlist file path.
Path to the circuit netlist file.
schematic_design_name : str
Name of the schematic design.
parameters : dict, optional
Name and value of the circuit parameters.
Parameters must be provided as a dictionary, where the key is the parameter name
and the value is the parameter value.
If the dictionary is provided, the ``netlist_file_path`` parameter is automatically
set to an empty string.
The default is ``None``.

Returns
-------
Expand Down Expand Up @@ -1967,7 +1974,13 @@ def edit_external_circuit(self, netlist_file_path, schematic_design_name):
sources_type_array.append(2)
elif source_type == "SPEED":
sources_type_array.append(3)
self.oboundary.EditExternalCircuit(netlist_file_path, sources_array, sources_type_array, [], [])
names = []
values = []
if parameters:
names = list(parameters.keys())
values = list(parameters.values())
netlist_file_path = ""
self.oboundary.EditExternalCircuit(netlist_file_path, sources_array, sources_type_array, names, values)
return True

@pyaedt_function_handler(setupname="name", setuptype="setup_type")
Expand Down
Loading