Navisworks API: Export Model or Model Items to FBX

By Xiaodong Liang

Navisworks product can export whole model to FBX. 

Model

There is not a direct way to export some model items only. However, it can be workaround by hiding unnecessary items, and exporting. Then, only those visible items will be exported.

Modelitems

The snapshot below is after the FBX is translated by the services of Autodesk Forge, and rendered in Forge Viewer. I simply played with the Autodesk app that is based on the related technologies of Forge: https://a360.autodesk.com/viewer/

Forge

From API perspective, no direct method to export FBX, but you can find out the built-in plugin of Exporting and execute it. The code snippet below is a demo. 

 

 


public override int Execute(params string[] parameters)
{
//********
// hide unnecessary model items. remain those items you wanted to export
//********
PluginRecord FBXPluginrecord =
Autodesk.Navisworks.Api.Application.Plugins.
FindPlugin("NativeExportPluginAdaptor_LcFbxExporterPlugin_Export.Navisworks");
if (FBXPluginrecord != null)
{
if (!FBXPluginrecord.IsLoaded)
{
FBXPluginrecord.LoadPlugin();
}
//save path of the FBX
string[] pa = { "c:\temp\mytest1.fbx" };
//way 1: by base class of plugin
//Plugin FBXplugin =
//           FBXPluginrecord.LoadedPlugin as Plugin;
//FBXplugin.GetType().InvokeMember("Execute",
//    System.Reflection.BindingFlags.InvokeMethod,
//    null, FBXplugin, pa);
//way 2: by specific class of export plugin
NativeExportPluginAdaptor FBXplugin =
FBXPluginrecord.LoadedPlugin as NativeExportPluginAdaptor;
FBXplugin.Execute(pa);
}
return 0;
}

Comments

9 responses to “Navisworks API: Export Model or Model Items to FBX”

  1. Thanks so much!
    Maybe you know, how we can export NWD,
    in such way as your export FBX?
    We need to split nwd to sub NWD.

  2. Is there a way of setting the parameters (eg FBX File Version) using this method too?

  3. Farhan Avatar
    Farhan

    This is working with Navisworks 2017 but not working in Navisworks 2018. Can anyone help?

  4. NativeExportPluginAdaptor_LcFbxExporterPlugin_Export.Navisworks ,i can’t find it,can anyone can help me?

  5. vornieres Avatar
    vornieres

    Hello,
    How can I export FBX file as ASCII data?
    I would like to know more detail about “param” of “FBXplugin.Execute()” .
    Anyone can help??

  6. francisco chong Avatar
    francisco chong

    How do you use this file in navisworks?

  7. I’d like to thank the author for writing such an insightful and informative blog post that is not just useful to the readers but also revealing.

  8. Vyacheslav Avatar
    Vyacheslav

    Not working with Nawisworks 2019. Completely useless.

  9. Works fine in 2020

Leave a Reply to Technostruct LLCCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading