Navisworks API Training Lab - Fundamentals
This folder contains a series of training labs for Navisworks API.
Prerequisites:
- Familiarity with C# .NET programming language *1)
- Basic knowledge of Navisworks product features
- Access to Navisworks Manage or Simulate 2016, and Microsoft Visual Studio 2012 Express or Professional version *2)
*2) You can also use later version of Visual Studio. Make sure to use .NET 4.5.
Labs
In this lab, we will quickly go through Navisworks product family, basics of Navisworks API, common use case scenarios of APIs, and available learning resources.
This lab introduces the plugin system, and demonstrate how to create a basic AddInPlugin and DockPanePlugin.
This lab introduces API structure in .NET, how to manipulate Document, what document parts, document info and grids & levels are.
This lab introduces model tree, model item, and how to access geometry attributes of model item.
This lab introduces the properties of objects and how to effectively find the specific properties.
This lab introduces the ways to find objects, the most efficient way and various scenarios to work with Search API.
This lab introduces current selection and selection sets, and how to manipulate them.
This lab introduces how to work with COM API from .NET with a couple of examples, e.g. add custom properties, read geometry primitives etc.
This lab introduces .NET events API.
This lab introduces viewpoint and saved viewpoint. How to manipulate camera position is also discussed.
This lab introduces how to use Navisworks .NET controls, i.e. ApplicationControl, DocumentControl and ViewControl.
Samples
Each lab has the corresponding sample(s). All of them can be opened by Lab_Examples.sln in Labs folder and can also be opened separately.
Make sure to open Visual Studio 2012 with .NET framework 4.5. Check if the necessary references are correctly loaded before compiling the projects.
The plugin samples have the post-build events defined in the Visual Studio project that deploys the binary to {Navisworks Install Path}\Plugins.
This is actually a copy of SDK sample "AppInfo", a useful tool for developers as it displays a lot of information regarding the document and the application as well as the relative relationships of classes. The button is available at [Tool add-ins *] tab.

A plugin that provides:
- a button on [Tool add-ins *] tab: hello world demo that pops out message box
- a button on context menu of current selection: hello world demo that pops out message box
- a dock pane named 'HelloWorld DockPane Plugin': hello world demo that pops out message box, and code that can dynamically load other plugins



A plugin that provides:
- a button on [Tool add-ins *] tab: pop out a form to demo various methods of document manipulations
- a button on [Tool add-ins *] tab: demo on how to load document info
- a button on [Tool add-ins *] tab: demo on how to manipulate grid and level.

A plugin with a dock pane named 'Model DockPane'. It can traverse the model tree, display them in the tree control with custom prefix or postfix string. It also shows how to override the geometry attributes: color, transparency, transformation.

A plugin with a button on [Tool add-ins *] tab named 'Manipulate Properties': dump the properties of an selected items, find the specific property of this item

A plugin with a button on [Tool add-ins *] tab named 'Search API'. It is demoed with the specific model MEP.nwc and a companion file price.xml in test file folder. This xml file is a dummy list of price for the corresponding element within this model. The sample can list all model item with its price, or search the items in a price range.

A plugin with a dock pane named 'Selection Dock Pane'. It can traverse the selection sets and display them in the tree control. It also shows how to add a new selection set with explicit selected items or search

A plugin that provides:
- a button on [Tool add-ins *] tab: add custom properties to the selected model items.
- a button on [Tool add-ins *] tab: dump geometry primitives of the selected items to a text file


Two demos:
- a plugin of EventWatcherPlugin. It subscribes application events and document events. fire when documents are switching
- a plugin with a button on [Tool add-ins *] tab. It subscribes event of current saved view changed and event of idle. When saved view changes, the corresponding snapshot will be exported

A plugin with a button on [Tool add-ins *] tab: it demos how to get saved view list, how to add saved view. how to move/rotate camera.

Four demos of standalone exe:
- application without view control
- single document application with view control
- multi documents application without communicating with COM API
- multi documents application with communicating with COM API
