Download

Is it possible call "Datasmtih Export" plugin in navisworks's custom plugin?

I am creating a plugin in navisworks manage 2022. Can I call the “Datasmtih Export” plugin within my custom plugin?

Hi tak_Iam !

Here’s an example snippet of C# to export a Datasmith scene using your own plugin :

PluginRecord Record = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("DatasmithNavisworksExporter.EpicGames");
Plugin Plugin = Record.LoadPlugin();
string[] Params = { @"C:\temp\test.udatasmith", "Merge=3", "Origin=10, 20.0, 300"};
Plugin.GetType().InvokeMember("Execute", System.Reflection.BindingFlags.InvokeMethod, null, Plugin, Params);

Hope this helps !

Cheers,
Antoine

1 Like

Hi Antoine,

Thank you for the replay. I can call the plugin now. Can I save the model automictically with this popup?

Regards,
Tak

is it possible save the model automictically?

If you want to automate the export, you will need to use the Autodesk.Navisworks.Api.Application.Automation.ExecuteAddInPlugin method of Navisworks.

See https://apidocs.co/apps/navisworks/2018/T_Autodesk_Navisworks_Api_ApplicationParts_ApplicationAutomation.htm

Cheers,
Antoine

Hi Antoine,

I tried 2 case, but both are not ok.
case 1: without params
result: err message requires target path

case 2: with params
result: still have save popup box

Regards,
Tak