Navisworks Manage - starting automation and selecting ActiveDocument

Navisworks Manage - starting automation and selecting ActiveDocument

Anonymous
Not applicable
3,378 Views
3 Replies
Message 1 of 4

Navisworks Manage - starting automation and selecting ActiveDocument

Anonymous
Not applicable

Hi

 

very new to API's for Autodesk products. trying to automate a Navisworks session using vb.net  and get a document's information - model, layers etc.

 

code below works in starting the session and loading the file but I cant then select the active document - gets the error attached -= I am sure I am doing something stupid... but help would be appreciated, cant seam to find any vb.net examples all c.

 

thanks in anticipation

 

error attached as screen shot

 

 

 

Imports Autodesk.Navisworks.Api.Automation
Imports Autodesk.Navisworks.Api
.
.

Dim NWApp As New Autodesk.Navisworks.Api.Automation.NavisworksApplication

NWApp.OpenFile(Zone_File_Name.Text)


NWApp.Visible = True


Dim NWDOC As Autodesk.Navisworks.Api.Document


NWDOC = Autodesk.Navisworks.Api.Application.ActiveDocument

 

0 Likes
Accepted solutions (1)
3,379 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

You cannot access the Navisworks application objects when running in automation mode, only call a plugin that does so using ExecuteAddInPlugin(pluginname).

 

So you need to encapsulate all your operations in a plugin, then execute your plugin from the automation app.

Message 3 of 4

Anonymous
Not applicable

Hi

 

thanks, very helpful - I thought that might be the case.

0 Likes
Message 4 of 4

ahmed.adel.hagag
Participant
Participant

hi @Anonymous  , could you share with me the project file ?

0 Likes