How do I run a script (.tcl) on HyperMesh directly from an Excel macro (Visual Basic)?
Hi,
I am creating a script .tcl, which is generated by a Macro on Visual Basic, depending on certain inputs that are introduced into an Excel SpreadSheet.
I would like to be able to run that generated .tcl file on HyperMesh and open the Model that it contains. But all of this, without the need of opening myself the program and clicking in the Toolbar to run this .tcl file.
INPUTS -> Excel SpreadSheet -> Macro (VBA) -> .tcl script-> open HyperMesh -> run the .tcl script
(All above is done within visual Basic environment)
Does anyone how to do it? Thanks in advance!
Carlos
Best Answer
-
Carlos_21231 said:
Hi Adriano,
Could you please show me an example? I am a nobby with -tcl language.
The path to HW executable in my computer is:
C:\Program Files\Altair\2020\hwdesktop\hw\bin\win64\hw.exe
The tcl scrip I want to open is here:
C:\Users\c.badillo\Desktop\Trial.tcl
Thanks in advance!
if it was a Windows command prompt, you would run something like:
call "C:\Program Files\Altair\2020\hwdesktop\hw\bin\win64\hw.exe" -tcl "C:\Users\c.badillo\Desktop\Trial.tcl" -b -clientconfig hwfepre.dat
-tcl set the path for your tcl script
-b to run in batch mode
-clientconfig defines that you're starting HyperMesh
Probably VB has some command to execute this command line, or call a .bat file.
1
Answers
-
You can call hw.exe and use some arguments such as -tcl to call a tcl script automatically.
Please take a look at the attached documentation.
I don't know how to call this from VB, but i'm pretty sure Google knows some command.
0 -
Hi Adriano,
Could you please show me an example? I am a nobby with -tcl language.
The path to HW executable in my computer is:
C:\Program Files\Altair\2020\hwdesktop\hw\bin\win64\hw.exe
The tcl scrip I want to open is here:
C:\Users\c.badillo\Desktop\Trial.tcl
Thanks in advance!
0 -
Carlos_21231 said:
Hi Adriano,
Could you please show me an example? I am a nobby with -tcl language.
The path to HW executable in my computer is:
C:\Program Files\Altair\2020\hwdesktop\hw\bin\win64\hw.exe
The tcl scrip I want to open is here:
C:\Users\c.badillo\Desktop\Trial.tcl
Thanks in advance!
if it was a Windows command prompt, you would run something like:
call "C:\Program Files\Altair\2020\hwdesktop\hw\bin\win64\hw.exe" -tcl "C:\Users\c.badillo\Desktop\Trial.tcl" -b -clientconfig hwfepre.dat
-tcl set the path for your tcl script
-b to run in batch mode
-clientconfig defines that you're starting HyperMesh
Probably VB has some command to execute this command line, or call a .bat file.
1 -
Thanks for the answer Adriano. It worked perfectly.
0