Message Boards Message Boards

1
|
3072 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Opening a notebook using C# ?

Posted 2 years ago

I can start Mathematica from C#, but the CubeOfCubes.nb argument cannot be found (The file "CubeOfCubes.nb" could not be found.).

    private void BtnKubus_Click(object sender, RoutedEventArgs e)
    {
        Process P = new Process();
        P.StartInfo.FileName = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
        P.StartInfo.Arguments = "CubeOfCubes.nb";
        P.Start();

CubeOfCubes.nb is in the same directory as Mathematica.exe. How do I have to proceed?

POSTED BY: Peter Leibundgut
3 Replies

The solution is simple:

    private void BtnMandelbrot_Click(object sender, RoutedEventArgs e)
    {
        const string program = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
        const string argument = "C:\\Projects/NB/Mandelbrot.nb";

        Process.Start(program, argument);
    }
POSTED BY: Peter Leibundgut

Finally, the notebook file should be integrated into the project. But as an argument in the same directory as Mathematica.exe it should work for now. Unfortunately not - not even with the full file path.

POSTED BY: Peter Leibundgut
Posted 2 years ago

Usually not a good idea to drop files into an applications installation directory. Anyway, have you tried using the full path?

P.StartInfo.Arguments = "C:\\Programme/Wolfram Research/Mathematica/12.2/CubeOfCubes.nb";
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract