How to get WB version?
GetFrameworkVersion() '20.1'
Only from 2021R1:
GetFrameworkVersion() '21.1' GetPersistedExternalVersionString() '2021 R1' GetPersistedProjectVersion() '211'
Some things are easier in Mechanical, at least in 2022R2:
version
In Mechanical you can try this (2022r2 at least):
import ansys import Ansys.Utilities version = Ansys.Utilities.ApplicationConfiguration.DefaultConfiguration.VersionInfo.VersionString
import ansys
import Ansys.Utilities
version = Ansys.Utilities.ApplicationConfiguration.DefaultConfiguration.VersionInfo.VersionString
And to add for the first WB way of getting the version, it can be used within Mechanical as:
import wbjn
project_version = wbjn.ExecuteCommand(ExtAPI, "returnValue(GetFrameworkVersion())")