A program to recognize and reward our most engaged community members
Can we run a script using tcl\tk script so it will provide all Hypemesh api's without opening Hypermesh.
Or can we import package related to Hypermesh script without opening hypermesh or running tool from command prompt.
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.
Yes, I have tried this using batch file
Hi Jouher,
How it can be done using batch file please let me know.
Thanks and regards
Vikas Kumar
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
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.
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.tcl
Thus it will look like
d: Altair\14.0\hw\tcl\tcl8.5.9\win64\bin\wish85 \\XYZ\Main_file.tcl
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
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
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
Please show your 'checkExit.tcl' content?
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_exit
I tested. It worked!
what is error in your case?
But file exist at given location .
My batch file I am attaching with this.
Unable to find an attachment - read this blog
there is abnormal characters in your path:
Maybe, encoding problem.
Try open notepad and edit batch file again
i have uploade batch file too you can see there is no such character available
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
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
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'
Thanks for your support now it's working.
Thanks alot.
Best regards,
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
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
@tinh