Running a script using tcl\tk
Answers
-
I am not sure. Maybe we can load some *.dll file containing hm api into tcl interp
try command 'info loaded' to see them
Instead, we can open hm in background so you don't see its GUI but all functions are available.
0 -
Yes, I have tried this using batch file
0 -
Hi Jouher,
How it can be done using batch file please let me know.
Thanks and regards
Vikas Kumar
0 -
Hi tinh,
While loading any .dll file from hyperworks tclsh stops working and giving error.
I am using command load 'C:/Program Files/Altair/14.0/hm/bin/win64/hwatnetworkdiagram_tcl.dll' and i am using tclsh 8.6 version.
Thanks
0 -
Hi,
maybe the file is loaded by hm. it needs other dependent libraries
I don't see any tcl command loading it
so other tcl version is also not able to load it.
0 -
Hi Vikas,
Create a batch file by Following this procedure:
d: (drive where Altair HM is installed)
Altair\14.0\hw\tcl\tcl8.5.9\win64\bin\wish85 \\PATHofTCL\Main_file.tclThus it will look like
d:
Altair\14.0\hw\tcl\tcl8.5.9\win64\bin\wish85 \\XYZ\Main_file.tcl0 -
Hi Jouher,
After that how to call .batch file and what will be content of batch file.
I have given this but it's not working i am running .bat file by using command 'exec batFile.bat' in tclsh prompt.
C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85\\D:\Vikas\Backup\TCL_TK\checkExit.tcl
It is showing
Thanks
0 -
Hi Vikas,
it is clear that you need quotes because your path has a space
'C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85' \Vikas\Backup\TCL_TK\checkExit.tcl
if path of your tcl file has spaces, you need to quote it, too
0 -
Only in C directory altair path has space but i kept it like
'C:/Program Files/Altair/13.0/hw/tcl/tcl8.5.9/win64/bin/wish85.exe' 'D:/Vikas/Backup/TCL_TK/checkExit.tcl'
still it's not working
0 -
Please show your 'checkExit.tcl' content?
0 -
A simple code ..
wm protocol . WM_DELETE_WINDOW chk_exit
proc chk_exit {} {
set ans [tk_messageBox -type yesno -icon question -message 'Are you sure you want to quit?']
if { $ans != 'no' } {
exit
}
};# chk_exit0 -
I tested. It worked!
what is error in your case?
0 -
It is showing
But file exist at given location .
My batch file I am attaching with this.
0 -
Hi,
there is abnormal characters in your path:
Maybe, encoding problem.
Try open notepad and edit batch file again
0 -
Hi tinh,
i have uploade batch file too you can see there is no such character available
0 -
Hi Tinh,
It's working if i am changing format of directory name to
'C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85.exe' 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'
instead of 'forwad slash ( / )' i am using 'Back slash (\)' .
Thanks for your support
0 -
Hi Tinh,
Now i am trying to run same .tcl file as file -> Run -> TCL\TK Script in HM by using this command
'C:\Program Files\Altair\13.0\hm\bin\win64\hmopengl.exe' 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'
but it's only opening the Hypermesh. And not running the checkExit.tcl file.
tinh or jouhar could you help me out to run the script.
Regards,
Vikas
0 -
The target command should be
(has ' -tcl ' with spaces before the tcl file)
'C:\Program Files\Altair\13.0\hm\bin\win64\hmopengl.exe' -tcl 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'
0 -
Hi tinh,
Thanks for your support now it's working.
Thanks alot.
Best regards,
Vikas
0 -
Hi tinh,
May i get some more information on this.
How you identified that there will be '-tcl' in between please if it is possible explain or share the link i will go through
Regards
Vikas Kumar
0 -
Well, this question is much more difficult than your previous question !
I know it for really long time ago (maybe version 8), so looking for it again was so tough /emoticons/default_wacko.png' title=':wacko:' />
You should spend your time to read all hm help documents!
in hm help > altair help home > hyperworks desktop applications > getting started >
hyperworks desktop overview > startup procedures and customization > starting hyperworks desktop application > hypermesh startup options
0 -
0