Calling OpenSees.exe from another application

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
hrsh
Posts: 2
Joined: Sat Apr 02, 2016 11:01 am

Calling OpenSees.exe from another application

Post by hrsh »

hi there
Is it possible to call opensees.exe from a console application , written in C#.NET, and pass a *.tcl (and/or *.txt or any source) file to it as an arguments?

EDIT:
I mean something like TclEditor does.

regards.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Calling OpenSees.exe from another application

Post by fmk »

yes .. not really an OpenSees question .. but what follows was taken from
http://stackoverflow.com/questions/3173 ... rp-program

System.Diagnostics.Process pProcess = new System.Diagnostics.Process();
pProcess.StartInfo.FileName = @"C:\Users\Vitor\ConsoleApplication1.exe";
pProcess.StartInfo.Arguments = "olaa"; //argument
pProcess.StartInfo.UseShellExecute = false;
pProcess.StartInfo.RedirectStandardOutput = true;
pProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pProcess.StartInfo.CreateNoWindow = true; //not diplay a windows
pProcess.Start();
string output = pProcess.StandardOutput.ReadToEnd(); //The output result
pProcess.WaitForExit();
hrsh
Posts: 2
Joined: Sat Apr 02, 2016 11:01 am

Re: Calling OpenSees.exe from another application

Post by hrsh »

Thank you for your response.

I figured out that I have to use a batch file too.
Post Reply