It seems that the only way to get access to the power of the Autodesk.Navisworks.Api from Autodesk.Navisworks.Api.Automation is by calling a plugin. This requires the plugin to be created, compiled and deployed through a separate VS project. Is there another way? I would like to be able to do something like this:
NavisworksApplication automationApplication = new Autodesk.Navisworks.Api.Automation.NavisworksApplication(); automationApplication.OpenFile("c:\\myModel.nwd"); Autodesk.Navisworks.Api.Application.ActiveDocument.SaveFile("c:\\myMode_2010l.nwd", DocumentFileVersion.Navisworks2010);
The above code fails because the ActiveDocument is not set.
Thanks
Hi,
This is as designed.
The Automation part of the .NET API is a small assembly that can be referenced by developer applications. It contains enough to start Navisworks and perform some basic actions; however complex actions should be achieved using a plug-in which can still be called through Automation.
About your code above, why you did not use automationApplication.SaveFile directly? Currently, Navisworks is still single doucument. So after opening the file by automationApplication.OpenFile, it is the active document.
I need to save as an older version of Navisowrks. The Automation API SaveFile method does not allow me to specify a Navisworks Document Version.
In any case, that was just a simple example. There is more complex functionality (like property based coloring) that I want to implement. I wanted to do it without having to create a separate plugin, but it seems it is not possible. This imposes a severe limitation on the design of my application. If only I could get an instance of the ActiveDocument from the Automation API, that would solve the problem. Do you know if Autodesk has any plans of doing something like this?
Hi jbiaggini ,
Sorry I do not see a plan. Before logging a wish, I'd like to collect more requirement that is could be done by automation only. Basically, automation is to manipulate in application / document level such as you want to save to a lower version. I cannot guarantee this would be implemented, but please feel free to raise more what you think are fine to be exposed in automation.
After loading a document using the Automation API, I would like to be able to get an instance of the Autodesk.Navisworks.Api.ActiveDocument from the Automation API without having to call a plugin.