Description
Hi. I'm new to Navisworks API development, but I created a plugin to search and select models. It's very simple: it creates a DockPane that lets the user choose a category, a property and the value.
My goal is to have a server machine that listens to a port, locally starts Navisworks when it gets a request and automatically runs my plugin. I already managed to implement the first part with System.Diagnostics.Process
.
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = NAVISWORKS_PATH,
Arguments = $"\"{filePath}\"",
UseShellExecute = true,
CreateNoWindow = false
};
Process.Start(psi);
Now, I need the server to get both the file to open and the model to select as parameters, something like Arguments = $"\"{filePath}\" \"{modelId}\"",
.
The problem is cannot get it to work, it tries to open {modelId}
as another file. I found out about Navisworks Command Line Options and the -ExecuteAddinPlugin
flag. I tried it, Navisworks runs the plugin but it doesn't open the file, so clearly I'm doing something wrong.
Please, help me understand how the Command Line Options works, or any other way if there is a better one. Thank you!
What I've tried
Configuration:
- Windows 11
- Visual Studio 2022
- Windows Form Application template (.NET Framework 4.8)
- Navisworks Manage 2023
- I tried:
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = NAVISWORKS_PATH,
Arguments = $"\"{filePath}\"",
UseShellExecute = true,
CreateNoWindow = false
};
Process.Start(psi);
Navisworks opens the file.
- I tried:
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = NAVISWORKS_PATH,
Arguments = $"\"{filePath}\" \"{modelId}\"",
UseShellExecute = true,
CreateNoWindow = false
};
Process.Start(psi);
Navisworks opens the file, but also tries to open modelId
as another file.
- I tried:
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = NAVISWORKS_PATH,
Arguments = $"\"-ExecuteAddinPlugin\" \"MyPlugin.MYORG\" \"{modelId}\" \"{modelPath}\"",
UseShellExecute = true,
CreateNoWindow = false
};
Process.Start(psi);
Navisworks starts and runs the plugin, but it doesn't open the file.