Jump to content
Sign in to follow this  
tutuccio88

Try to launch Nastran from Hypermesh

Recommended Posts

Hi, i'm trying to add a button to launch nastran directly from inside Hypermesh. This is what i wrote (that doesn't work):


 


*createbutton(5,"Nastran 2013.0",10,5,5,RED,"Open Nastran 2013.0","LaunchNastran")

 

*beginmacro(LaunchNastran)

exec cmd.exe /c start /wait C:\MSC.Software\MSC_Nastran\20130\bin\nastranw.exe

*endmacro()

 

 

Any suggestion?

Share this post


Link to post
Share on other sites
Guest

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.


Share this post


Link to post
Share on other sites

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! :) )

 

(yes, i updated Nastran to 2013.1 in the meanwhile ahahha)
 

Share this post


Link to post
Share on other sites

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")


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...