Skip to content

Get version of running AEDT #3902

Closed Answered by Samuelopez-ansys
fwlfHS asked this question in Q&A
Discussion options

You must be logged in to vote

@fwlfHS

If you have one single AEDT session, it is easy to find. The following code returns the AEDT processes given a version, you can use a similar approach to get the version when the loop finds the AEDT process:

import psutil

version = "2023.2"
keys = ["ansysedt.exe"]
if not version:
    return []
if version and "." in version:
    version = version[-4:].replace(".", "")
if version < "222":
    version = version[:2] + "." + version[2]
sessions = []
for p in psutil.process_iter():
    try:
        if p.name() in keys:
            cmd = p.cmdline()
            if not version or (version and version in cmd[0]):
                if "-grpcsrv" in cmd:
                    if not version or …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fwlfHS
Comment options

Answer selected by fwlfHS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants