peristence of pyaedt session through iterations #4670
-
So i have the following script: def test(var): here the test are modifications manipulated by an algorithm through the var inputs. In order to save time, my thought process is to make the pyaedt session persistent and to not open and close it in each iteration. Nevertheless, pyaedt and hfss should always be defined in order for the following commands to run. Any ideas on how to do this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @gkorompi , please describe a bit better the workflow. I need to understand what “vars” means and its context |
Beta Was this translation helpful? Give feedback.
-
Hello @Samuelopez-ansys, vars are the variables manipulating my structure, i.e. patch width. The algorithm changes this values in order to achieve the optimum result. My question is, how to keep the same aedt session open (project + design) through iterations (test is called multiple times). Because in the way that i have written it above, a new session is opened and later released in each iteration. Ty |
Beta Was this translation helpful? Give feedback.
-
Okay yes you are right, i can pass hfss as a variable in the function: def test(var,hfss): i thought this was not possible as it would corrupt the session. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
@gkorompi But why do not simply create the pyaedt object at the beginning? I need more context because I would first create the pyaedt object:
Then:
and there you can call the method.