FileInteractiveResolving Event and getting Name of Unresolved files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using the Labs I have got the Event Handler working and I can capture the FileInteractiveResolving event so am getting a Message Box when I want to see it.
I however don't know how to actually get the file name/names of the Unresolved files that are about to appear in the dialog box.
If I use the Active document it is still associated with the current document I started in as it hasn't actually got to the point of opening the new file.
How do I get the unresolved paths of the file I am opening?
We are trying to automate the NW creation and I want to put any Unresolved files in a Log file so we can keep an eye if files are dropping out of the model.
Below works ok except the Model Collection is from the file already open, not the file you are in the process of opening.
Public Overrides Sub OnLoaded() AddHandler Autodesk.Navisworks.Api.Application.FileInteractiveResolving, AddressOf XXXX_NW_Event_FileInteractiveResolving_Handler End Sub Public Overrides Sub OnUnloading() RemoveHandler Autodesk.Navisworks.Api.Application.FileInteractiveResolving, AddressOf XXXX_NW_Event_FileInteractiveResolving_Handler End Sub Public Sub XXXX_NW_Event_FileInteractiveResolving_Handler(ByVal sender As Object, ByVal e As System.EventArgs) MessageBox.Show("Start XXXX_NW_Event_FileInteractiveResolving_Handler") Dim my_nw_actdoc As Autodesk.Navisworks.Api.Document = Autodesk.Navisworks.Api.Application.ActiveDocument Dim my_model_col As Autodesk.Navisworks.Api.ModelItemEnumerableCollection = my_nw_actdoc.Models.RootItems For Each my_model As Autodesk.Navisworks.Api.ModelItem In my_model_col MessageBox.Show("my_model.DisplayName : " & vbCrLf & my_model.DisplayName & vbCrLf & "my_model.Model.FileName : " & vbCrLf & my_model.Model.FileName & vbCrLf & "my_model.Model.SourceFileName : " & vbCrLf & my_model.Model.SourceFileName) Next
MessageBox.Show("End XXXX_NW_Event_FileInteractiveResolving_Handler") End Sub