Open directly an aedt file #4680
-
How to open directly an aedt file? In Maxwell Scripting I do this: import ScriptEnv aedt_ver = 'Ansoft.ElectronicsDesktop'oAnsoftApp = win32com.client.Dispatch(aedt_ver)oDesktop = oAnsoftApp.GetAppDesktop()#ScriptEnv.Initialize("Ansoft.ElectronicsDesktop") oDesktop.OpenProject(work_file) Thanks in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@Herve-L1 The script you provided is how you can interact directly with the AEDT API. But PyAEDT provides an extra layer to avoid this call, or at least to make it not visible. You can: from pyaedt import Desktop Open AEDTdesktop= Desktop() Load projectaedtapp = desktop.load_project(work_file) Your automationRelease AEDTdesktop.release_desktop() This is just one option, if you know the application to open, for example HFSS, you can do from pyaedt import Hfss app = Hfss(projectname=work_file) Here you can find more examples: |
Beta Was this translation helpful? Give feedback.
-
Hi Samuel
My problem is solved, sorry for this late reply.
Best regards
Hervé
De : Samuel Lopez ***@***.***>
Envoyé : vendredi 17 mai 2024 15:24
À : ansys/pyaedt ***@***.***>
Cc : Lavalee, Herve (GE Vernova) ***@***.***>; Mention ***@***.***>
Objet : EXT: Re: [ansys/pyaedt] Open directly an aedt file (Discussion #4680)
AVERTISSEMENT: cet email provient de l'extérieur de GE. Veuillez valider l'adresse e-mail de l'expéditeur avant de cliquer sur les liens ou les pièces jointes, car ils risquent de ne pas être sûrs.
Closed #4680<#4680> as resolved.
—
Reply to this email directly, view it on GitHub<#4680>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BH4QAIHUPSX4UDIIOF7FIGLZCYAFHAVCNFSM6AAAAABHZXEO7GVHI2DSMVQWIX3LMV45UABFIRUXGY3VONZWS33OIV3GK3TUHI5E433UNFTGSY3BORUW63R3GEZDQMJWHAYA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
@Herve-L1 The script you provided is how you can interact directly with the AEDT API. But PyAEDT provides an extra layer to avoid this call, or at least to make it not visible.
You can:
from pyaedt import Desktop
Open AEDT
desktop= Desktop()
Load project
aedtapp = desktop.load_project(work_file)
Your automation
Release AEDT
desktop.release_desktop()
This is just one option, if you know the application to open, for example HFSS, you can do
from pyaedt import Hfss
app = Hfss(projectname=work_file)
Here you can find more examples:
https://aedt.docs.pyansys.com/version/stable/User_guide/index.html