Skip to content

Variable Defenition Error in Pyaedt #6710

@Moojtaba3374

Description

@Moojtaba3374

[test_conversion_rev2.py](https://github.com/user-attachments/files/22618419/test_conversion_rev2.py,
in atttached pyaedt code for HFSS automation, i have several variables inside circuit design. i want to make a loop with U4_index(project variable), h1 & cap (local variables in circuit design) and analyze the circuit for set of parameters. push excitations and calculate total efficiency. then export report for all the plots of s parameters , voltage and total efficiency. i will get folllowing error for this code for definition of h1 & cap :


/users/mz080139/PycharmProjects/PythonProject/.venv/bin/python /scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/test_conversion_rev2.py
PyAEDT INFO: Python version 3.12.11 (main, Jun 19 2025, 11:41:33) [GCC 8.5.0 20210514 (Red Hat 8.5.0-27)].
PyAEDT INFO: PyAEDT version 0.20.0.
PyAEDT INFO: Initializing new Desktop session.
PyAEDT INFO: Log on console is enabled.
PyAEDT INFO: Log on file /tmp/pyaedt_mz080139_ea0efddb-0040-459e-ae5f-2a3739bc1851.log is enabled.
PyAEDT INFO: Log on AEDT is disabled.
PyAEDT INFO: Debug logger is disabled. PyAEDT methods will not be logged.
PyAEDT INFO: Launching PyAEDT with gRPC plugin.
PyAEDT INFO: New AEDT session is starting on gRPC port 39241.
PyAEDT INFO: Electronics Desktop started on gRPC port: 39241 after 16.907184600830078 seconds.
PyAEDT INFO: AEDT installation Path /apps/ansoft/AnsysEM24.2.1/v242/Linux64
PyAEDT INFO: Ansoft.ElectronicsDesktop.2024.2 version started with process ID 1346852.
PyAEDT INFO: Python version 3.12.11 (main, Jun 19 2025, 11:41:33) [GCC 8.5.0 20210514 (Red Hat 8.5.0-27)].
PyAEDT INFO: PyAEDT version 0.20.0.
PyAEDT INFO: Returning found Desktop session with PID 1346852!
PyAEDT INFO: Project Cir_C1_h1_sweep_IFA has been opened.
PyAEDT INFO: Active Design set to 0;Circuit1
PyAEDT INFO: Active Design set to 0;Circuit1
PyAEDT INFO: Aedt Objects correctly read
PyAEDT INFO: Python version 3.12.11 (main, Jun 19 2025, 11:41:33) [GCC 8.5.0 20210514 (Red Hat 8.5.0-27)].
PyAEDT INFO: PyAEDT version 0.20.0.
PyAEDT INFO: Returning found Desktop session with PID 1346852!
PyAEDT INFO: Project Cir_C1_h1_sweep_IFA set to active.
PyAEDT INFO: Active Design set to 0;Circuit1
PyAEDT INFO: Aedt Objects correctly read
PyAEDT ERROR: **************************************************************
PyAEDT ERROR: File "/scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/test_conversion_rev2.py", line 15, in
PyAEDT ERROR: cir["cap"] = "0.0e-12"
PyAEDT ERROR: AEDT API Error on set_variable
PyAEDT ERROR: Last Electronics Desktop Message - [error] script macro error: property 'cap' does not exist. (05:17:18 am sep 30, 2025)
PyAEDT ERROR: Method arguments:
PyAEDT ERROR: name = cap
PyAEDT ERROR: expression = 0.0e-12
PyAEDT ERROR: **************************************************************
PyAEDT ERROR: **************************************************************
PyAEDT ERROR: File "/scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/test_conversion_rev2.py", line 16, in
PyAEDT ERROR: cir["h1"] = "5e-3"
PyAEDT ERROR: AEDT API Error on set_variable
PyAEDT ERROR: Last Electronics Desktop Message - [error] script macro error: property 'h1' does not exist. (05:17:19 am sep 30, 2025)
PyAEDT ERROR: Method arguments:
PyAEDT ERROR: name = h1
PyAEDT ERROR: expression = 5e-3
PyAEDT ERROR: **************************************************************
Variables set successfully
PyAEDT INFO: ModelerCircuit class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Parsing /scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/Cir_C1_h1_sweep_IFA.aedt.
PyAEDT INFO: File /scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/Cir_C1_h1_sweep_IFA.aedt correctly loaded. Elapsed time: 0m 0sec
PyAEDT INFO: aedt file load time 0.07863569259643555
PyAEDT INFO: ModelerNexxim class has been initialized!
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT ERROR: **************************************************************
PyAEDT ERROR: File "/scratch/mz080139/Thin_phone_study/new_design/C1_h1_sweep_V1/test_conversion_rev2.py", line 22, in
PyAEDT ERROR: cir.push_excitations("S1")
PyAEDT ERROR: AEDT API Error on push_excitations
PyAEDT ERROR: Last Electronics Desktop Message - [error] script macro error: property 'h1' does not exist. (05:17:19 am sep 30, 2025)
PyAEDT ERROR: Method arguments:
PyAEDT ERROR: instance = S1
PyAEDT ERROR: **************************************************************
Excitations pushed successfully
PyAEDT ERROR: A(n) <class 'TypeError'> error occurred while retrieving information for the active AEDT sessions: argument of type 'NoneType' is not iterable
PyAEDT INFO: Desktop has been released and closed.

Process finished with exit code 0


i will appriciate any feedback or comment on this issue

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions