Skip to content

Commit

Permalink
Add TK variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed May 8, 2024
1 parent 7e6826e commit 11e07fe
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pyaedt/workflows/templates/Run_PyAEDT_Toolkit_Script.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ def main():
os.environ["PYAEDT_SCRIPT_VERSION"] = version
if version > "2022.2":
os.environ["PYAEDT_SCRIPT_PORT"] = str(oDesktop.GetGrpcServerPort())
if version > "2023.1":
os.environ["TCL_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tcl8.5")
os.environ["TK_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tk8.5")
os.environ["TKPATH"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tk8.5")
else:
os.environ["TCL_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tcl8.5")
os.environ["TK_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tk8.5")
os.environ["TKPATH"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tk8.5")

if is_linux:
edt_root = os.path.normpath(oDesktop.GetExeDir())
os.environ["ANSYSEM_ROOT{}".format(version)] = edt_root
Expand All @@ -59,6 +52,15 @@ def main():
os.environ["LD_LIBRARY_PATH"] = ":".join(ld_library_path_dirs_to_add) + ":" + os.getenv(
"LD_LIBRARY_PATH", "")

if version > "2023.1":
os.environ["TCL_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tcl8.5")
os.environ["TK_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tk8.5")
os.environ["TKPATH"] = os.path.join("{}/commonfiles/CPython/3_10/linx64/Release/python/lib".format(edt_root), "tk8.5")
else:
os.environ["TCL_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tcl8.5")
os.environ["TK_LIBRARY"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tk8.5")
os.environ["TKPATH"] = os.path.join("{}/commonfiles/CPython/3_7/linx64/Release/python/lib".format(edt_root), "tk8.5")

my_env = dict(os.environ.copy())
command = [python_exe, pyaedt_script]
subprocess.Popen(command, env=my_env)
Expand Down

0 comments on commit 11e07fe

Please sign in to comment.