ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
213 stars 129 forks source link

Creating two designs in the same project and same aedt is trivial #5510

Open hui-zhou-a opened 2 days ago

hui-zhou-a commented 2 days ago

Description of the feature

When there are more than one active AEDT, creating two designs in one project is trivial. Below is a safe way to do it,

ds = Desktop(specified_version="2024.2",
             non_graphical=False,
             new_desktop_session=True,
             close_on_exit=True,
             student_version=False)

h3d = Hfss3dLayout(
    project="project_1",
    design="h3d",
    port=ds.aedt_process_id,
    aedt_process_id=ds.aedt_process_id,
    version=ds.aedt_version_id)

ipk = Icepak(
    project="project_1",
    design="ipk",
    port=ds.aedt_process_id,
    aedt_process_id=ds.aedt_process_id,
    version=ds.aedt_version_id)

Steps for implementing the feature

It would be better if the user can do below

ds = Desktop(specified_version="2024.2",
             non_graphical=False,
             new_desktop_session=True,
             close_on_exit=True,
             student_version=False)

proj = ds.project(name="project)

h3d = proj.Hfss3dLayout(name="h3d")

ipk = proj.Icepak(name="ipk")

Useful links and references

No response

Samuelopez-ansys commented 11 hours ago

Hi @hui-zhou-a ,

This would mean creating another layer (class) for project management, and this is for now not considered in the PyAEDT roadmap But I do agree, that we could add an "add_new_project" method at Desktop level. Because for now, there is only New Project addition at Design level.

Something like:

ds = Desktop(specified_version="2024.2",
non_graphical=False,
new_desktop_session=True,
close_on_exit=True,
student_version=False)

proj_name = ds.new_project(name="project)

h3d = proj.Hfss3dLayout(name="h3d", project=proj_name)

ipk = proj.Icepak(name="ipk", project=proj_name))

What do you think?

hui-zhou-a commented 5 hours ago

I agree.

It should also be able to list all projects ds.projects