Autodesk Developer Network

Autodesk App Store - Information for Navisworks Developers

Overview

Autodesk® Navisworks® Manage and Autodesk® Navisworks® Simulate support Apps delivered by Autodesk App Store. Apps can be used to add both.NET API plugins and NWcreate plugins.

Getting Started

Production Apps will be delivered as an MSI installer that is produced after you submit your App to ADN. However it is possible to test your App by simulating what the installer would do, and simply copying your deliverables into the correct place on disk. No registration is required. Here we describe how to produce an App that includes a .NET API plugin.

Prerequisites

  • The non-registration mechanism can work from Navisworks  2015. While our .NET API of one release is only compatible within one major version. So if your application will support multi-releases, you will need to compile the binaries with each version of .NET API and package them together. The instruction below will indicate how to specify the corresponding binary.
  • You will need Microsoft Visual Studio 2012 or later and .NET Framework = 4.5

Locations

Two root folders are supported for loading Autodesk Apps. Note that it is not just Navisworks that uses these folders; all Autodesk products share them. The per-user root folder is:

  • %APPDATA%\Autodesk\ApplicationPlugins

Whilst the per-machine root folder is:

  • %PROGRAMDATA%\Autodesk\ApplicationPlugins

Apps installed in the per-user folder will only be available for that user, whereas Apps installed in the per-machine folder will be available for all users.

Your ‘bundle’

Inside one of the above root folders you need to create a uniquely named folder whose name ends in “.bundle”. Directly inside this folder should be a configuration file named “PackageContents.xml”. There should also be a “Contents” subfolder where you put your deliverables.

So the minimum ‘development’ installation would have 2 files, and be along the lines of:

  • %APPDATA%\Autodesk\ApplicationPlugins\ADSK.MyApp.bundle\ PackageContents.xml
  • % APPDATA %\Autodesk\ApplicationPlugins\ ADSK.MyApp.bundle \ Contents\ v14\ ADSK. MyPlugin.dll

Notes:

  • This assumes we target at a bundle with binary of Navisworks 2017 only, where ‘v14’ is just a name of the sub folder to deploy the binary that is compiled with .NET API of 2017. If a binary of 2016, it can be ‘v13’.
  • Real installations will probably require more than 2 files, as they will contain documentation, icons, etc.
  • Real installations will require “ADSK” to be replaced by your unique ADN Developer ID. Recommend to name this ID by reversed version of your domain name, e.g. com.autodesk or uk.co.autodesk
  • Your folder name must be unique across all Autodesk bundles. Prefixing with your own unique Developer ID is a good starting point.
  • The name of each DLL you install must be unique within a running session of Navisworks. It must not clash with DLLs that Navisworks installs, or with those provided by any other Apps. Prefixing with your unique Developer ID is a good starting point.

PackageContents.xml

The minimum ‘development’ configuration file will be along the lines of:

<?xml version="1.0" encoding="utf-8"?>

<?xml version="1.0" encoding="utf-8"?>

<ApplicationPackage > 

  <Components Description="2017 parts">

    <RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw14" SeriesMax="Nw14" />

    <ComponentEntry AppType="ManagedPlugin"ModuleName="./Contents/v14/ADSK.MyPlugin.v14.dll">    

    </ComponentEntry>

  </Components>

 

  <Components Description="2016 parts">

    <RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw13" SeriesMax="Nw13" />

     <ComponentEntry AppType="ManagedPlugin"ModuleName="./Contents/v13/ADSK.MyPlugin.v13.dll">    

  </Components>

</ApplicationPackage>

This example specifies a single ‘Component’:

  • OS="Win64": This component works for 64-bit product only.
  • Platform="NAVMAN|NAVSIM": This component works in both Navisworks Manage and Navisworks Simulate.
  • SeriesMin="Nw14"   SeriesMax="Nw14": Nw14 means this component works for Navisworks 2017 version. As said above, our .NET API of on release is only compatible within one major version. Similarly, Nw13 means this is a component that works with Navisworks 2016.
  • AppType="ManagedPlugin": This component is a managed .NET assembly that contains plugins targeted at the Navisworks .NET API.
  • ModuleName="./Contents/v14/ADSK.MyPlugin.dll" : Specifies the relative path to the components .NET Assembly. We’ve put it in a ‘v14’ folder signifying it’s targeted at “Navisworks 2017” only.   You can put specific release of binary in specific folders, or name them uniquely in one folder.

Notes:

  • Real configuration files will require more content than this.
  • The <ApplicationPackage> element can contain multiple <Components> elements. Each component can target a different Platform and Series.

ADSK.MyPlugin.dll

In this example the DLL pointed to by ModuleName is a managed .NET assembly. This could be written as a C# ‘Class Library’, and could contain a basic “Hello World” AddInPlugin as defined in the following code.

using Autodes.Navisworks.Api.Plugins;
...
 [PluginAttribute("MyPlugin", "ADSK", DisplayName = "Myplugin : Hello World")]
 [AddInPluginAttribute(AddInloation.AddIn)]
 public class Myplugin : AddInPlugin
 {
 public override int Execute(params string[] parameters0
 {
  MessageBox.Show("hello World");
  return 0;
 }
 }
...  

Notes:

  • You will have to add a reference to %PROGRAMFILES%\Autodesk\Navisworks Manage <release number>\Autodesk.Navisworks.Api.dll. (‘CopyLocal’ should be set to False).
  • Real code should use your own unique Developer ID.

More

NWcreate ‘File loader’ support.

Components can also specify that the DLL is an NWcreate style ‘File loader’. To do this use AppType="NativeLoader".

More information

The ADN team is here to help you be a successful publisher on Autodesk App Store. We’ll do whatever we can do to help you. You are welcome to email appsubmissions@autodesk.com if you have any further questions after reviewing these guidelines and the other documentation on www.autodesk.com/developapps.

Thank you for participating on Autodesk App Store.

For reference of those developers who want to pop out F1 help with the plugin: currently, the way is to hook up F1 by Windows API to display your own help page.