Jul-18-2018, 11:43 PM
Hi,
I am trying to run a Python script that calls the optimization program Hypermesh. This program uses scripts and functions in tcl that we are using to automate the optimization process. Is there a way to pass information from Python to these tcl functions? Below is the Python code I have been using.
Thanks,
Kaitlyn
I am trying to run a Python script that calls the optimization program Hypermesh. This program uses scripts and functions in tcl that we are using to automate the optimization process. Is there a way to pass information from Python to these tcl functions? Below is the Python code I have been using.
Thanks,
Kaitlyn
import subprocess import os #Save file names as variables hmPath=r"C:\Program Files\Altair\2017\hm\bin\win64\hmopengl.exe" scriptName=r"C:\Users\Kaitlyn\Documents\PythonREU\createMaterial.tcl" input = 100 #Runs tcl script in Hypermesh callScript='"{0}" -tcl "{1}"'.format(hmPath,scriptName) subprocess.call(callScript) #How I attempt to run tcl function with inputs from Python in Hypermesh callScript='"{0}" -tcl "{1}" {2}'.format(hmPath,scriptName,input) subprocess.call(callScript)