ansys/pyaedt

Add SetActiveDesign to the PyAEDT API

Closed this issue · 4 comments

Description of the feature

Currently the SetActiveDesign() is accessible via oproject legacy.
Any chance to make it available in the PyAEDT API?

Steps for implementing the feature

To reproduce the current status:

circuitapp = Circuit(project=projectName, design=designName)
circuitapp.oproject.SetActiveDesign(targetDesignName)

Useful links and references

No response

Hi @alevIFX ,

This is already available in PyAEDT through: set_active_design(design_name).
For example: hfss.set_active_design(hfss.design_name)

Hope this helps,

Giulia

I meant for Circuit and Netlist design, not HFSS design.
If you instantiate a Circuit() class for a Circuit Design and try to make a Netlist Design active then the Circuit.set_active_design() will not work.

For completeness, the idea is to switch between different designs (and design types).
I've found that

desktop.active_design(name=designName)

(where desktop is the object of the Desktop class) works and with this object also the GetModule function is available.

Look likes that the design activation shall be executed from the desktop object and not from the tool class.

Unfortunately the design name is retrieved differently depending if the design is a netlist or circuit design since the related function is not called nor working the same way.

Hi @alevIFX .

After this new implementation #5094.

This is how you could control both kind of designs in your script:

import ansys.aedt.core

app = ansys.aedt.core.Desktop(version="2024.1", new_desktop=False)

circuit = ansys.aedt.core.Circuit()

circuit_netlist = ansys.aedt.core.CircuitNetlist()

circuit_netlist.release_desktop(False, False)