randyk
Ansys Employee

Hi Keniel,

Please try the following:

$  export ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE=1
$  ansysedt.exe -features=beta -ng -runscriptandexit []


Please search AEDT help for "
Running Ansys Electronics Desktop from a Command Line"

Note - '-ng' and '-runscriptandexit' have been available since 2019R1

Desktop automation is in terms of COM calls to the various COM objects exposed by desktop. This has always been unconditionally supported in a general-purpose graphical mode (Desktop with a GUI or in Iconic mode without specialized -batchextract etc modes). When desktop is run in non-graphical mode (-ng in the command line), recorded scripts cannot be played back: instead, a select few commands are available via the -batchextract script.

To ensure general command execution ability, AnsysET enforced the need for a GUI system: the user’s compute environment required a graphics subsystem (X Servers on Linux in particular) to be configured.

Some commands when run graphically would be somewhat expensive because of the needed User Interface updates and sometimes a user composes a script with hundreds of such expensive calls slowing the execution down noticeably. Forcing the user to run desktop in GUI mode forced the performance penalties as well.

Non Graphical Command Limitations

2019 R1 release starts making progress toward allowing all commands to be run non-graphically. commands will be transitioned in phases and some graphical commands like Plot Export will be unavailable initially. If such commands are used, script execution will be terminated with a suitable error message.

Enabling from the GUI

Bring up the Options and enable “beta” features. If enabling all beta features is not desired, then the command line will have to be used with the “-features=SF6694_Non_Graphical_Command_execution” parameter.

Enabling from the Command Line

Invoke desktop in ng mode for script execution by specifying the beta flag: this allows the existing -runscriptandexit command-line parameter to work in non-graphical mode as well.

ansysedt.exe -features=beta -ng -runscriptandexit []

Note: -features=”beta” turns on all beta features. If there is a need to disable all beta features except “non-graphical command execution”, the more specific “-features=SF6694_Non_Graphical_Command_execution” can be used instead.

Enabling For Workbench Scenarios

Prior to 19R1, when workbench was run in batch mode (-B command line parameter), several methods of the Electromagnetics Addin are disabled. This saga-feature enables them back and allows all Workebench<->AnsysEDT interaction to occur fully non-graphically. To enable this, you must set the following environment variable.

ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE=1

Enabling for stand-alone scripting scenarios

For stand-alone scripting scenarios (where the ipy64.exe interpreter is used instead of ansysem.exe to run the script). Refer to online help and search for “Standalone IronPython” for additional details.

Standalone graphical scripts, have the following preamble.

import sys

sys.path.append("")

sys.path.append("/PythonFiles/DesktopPlugin")

import ScriptEnv

ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")

This is used for the typical graphical AnsysEDT COM server. For, non-graphical com servers, the final ScriptEnv.Initialize is replaced by ScriptEnv.InitializeNew.

  • Note: InitializeNew does not take the COM ProgID since it launches the Exe directly by computing a path relative to the ScriptEnv.py module.
  • Note: InitializeNew specifies that a new instance is to be launched everytime. This helps by not connecting to existing COM server.

import sys

sys.path.append("")

sys.path.append("/PythonFiles/DesktopPlugin")

import ScriptEnv

ScriptEnv.InitializeNew( NonGraphical = True)