If you are using a wrapper library that exposes environment properties:
In a CAD management or DevOps environment, you rarely deal with just one version of AutoCAD. You might have scripts that need to run on AutoCAD 2020, 2022, and 2024 simultaneously. env.acadreleasename
$(getvar, env.acadreleasename)