Try to launch Nastran from Hypermesh
Hi, i'm trying to add a button to launch nastran directly from inside Hypermesh. This is what i wrote (that doesn't work):
Answers
-
in tcl, file path use '/' as in Unix and not '\' as windows, you could use file normalize. Also use '\\' instead of '\'
Try using:
exec cmd.exe /c start /wait [ file normalize 'C:\\path\\to\\nastran\\bin\\nastranw.exe' ];or just
exec [ file normalize 'C:\\path\\to\\nastran\\bin\\nastranw.exe' ];Hope this helps.
0 -
hi,
try using *evaltclstring to run tcl commands inside macro file
0 -
ok, thanks to your help this code actually works:
*createbutton(5,'Launch Nastran 2013.1',-5,0,10,RED,'Wanna launch Nastran?',EvalTcl,'LaunchNastran.tcl')
in userpage.cmd
and
exec cmd.exe /c start /wait [file normalize \\MSC.Software\\MSC_Nastran\\20131\\bin\\nastranw.exe'];
in LaunchNastran.tcl....
I was wondering if there was a way to write everything in a single file... i tried with *evaltclstring but it doesn't work (or i wrong wrote it! /emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'> )(yes, i updated Nastran to 2013.1 in the meanwhile ahahha)
0 -
hi
to use single file, put *evaltclstring into a macro:
*beginmacro('LaunchNastran')
*evaltclstring('exec cmd.exe /c start /wait [file normalize ...nastranw.exe]',0)
*endmacro()
and point your button to this macro
*createbutton(5,'Launch Nastran 2013.1',-5,0,10,RED,'Wanna launch Nastran?','LaunchNastran','LaunchNastran.tcl')
0