<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic FileInteractiveResolving Event and getting Name of Unresolved files in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/fileinteractiveresolving-event-and-getting-name-of-unresolved/m-p/9190284#M2965</link>
    <description>&lt;P&gt;Using the Labs I have got the Event Handler working and I can capture the&amp;nbsp;FileInteractiveResolving event so am getting a Message Box when I want to see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the unresolved paths of the file I am opening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below works ok except the Model Collection is from the file already open, not the file you are in the process of opening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;     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 : " &amp;amp; vbCrLf &amp;amp; my_model.DisplayName &amp;amp; vbCrLf &amp;amp; "my_model.Model.FileName : " &amp;amp; vbCrLf &amp;amp; my_model.Model.FileName &amp;amp; vbCrLf &amp;amp; "my_model.Model.SourceFileName : " &amp;amp; vbCrLf &amp;amp; my_model.Model.SourceFileName)
            Next&lt;BR /&gt;            MessageBox.Show("End XXXX_NW_Event_FileInteractiveResolving_Handler")
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2019 06:34:27 GMT</pubDate>
    <dc:creator>albarney99</dc:creator>
    <dc:date>2019-12-09T06:34:27Z</dc:date>
    <item>
      <title>FileInteractiveResolving Event and getting Name of Unresolved files</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/fileinteractiveresolving-event-and-getting-name-of-unresolved/m-p/9190284#M2965</link>
      <description>&lt;P&gt;Using the Labs I have got the Event Handler working and I can capture the&amp;nbsp;FileInteractiveResolving event so am getting a Message Box when I want to see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the unresolved paths of the file I am opening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below works ok except the Model Collection is from the file already open, not the file you are in the process of opening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;     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 : " &amp;amp; vbCrLf &amp;amp; my_model.DisplayName &amp;amp; vbCrLf &amp;amp; "my_model.Model.FileName : " &amp;amp; vbCrLf &amp;amp; my_model.Model.FileName &amp;amp; vbCrLf &amp;amp; "my_model.Model.SourceFileName : " &amp;amp; vbCrLf &amp;amp; my_model.Model.SourceFileName)
            Next&lt;BR /&gt;            MessageBox.Show("End XXXX_NW_Event_FileInteractiveResolving_Handler")
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 06:34:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/fileinteractiveresolving-event-and-getting-name-of-unresolved/m-p/9190284#M2965</guid>
      <dc:creator>albarney99</dc:creator>
      <dc:date>2019-12-09T06:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: FileInteractiveResolving Event and getting Name of Unresolved files</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/fileinteractiveresolving-event-and-getting-name-of-unresolved/m-p/9217452#M2966</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// sender=null, e.FileReference etc filled, called once per referenced aka included documents, depth first? include actual root document
//  comment: called repeatedly at launch with avatar files, twice for each document !
Application.FileResolving += (object sender, FileResolvingEventArgs e) =&amp;gt;
{ Debug.Print($"FileResolving '{e.FileReference}'"); };
Application.FileResolved += (object sender, FileResolvedEventArgs e) =&amp;gt;
{ Debug.Print($"FileResolved '{e.FileReference}'"); }; // sender=null, e.FileReference etc filled, called once per referenced aka included documents, depth first? include actual root document&lt;/PRE&gt;&lt;P&gt;See above for the events for FileResolving/Resolved.&lt;BR /&gt;For these events, you can use e.FileReference to get which file for each of the 2 events, maybe you could check for call to Resolving without call to Resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp;FileInteractiveResolving event you are using, you get even more info in the&amp;nbsp;FileInteractiveResolvingEventArgs so probably can directly use these ifo to do what you want, but I have not used this event yet.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 16:22:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/fileinteractiveresolving-event-and-getting-name-of-unresolved/m-p/9217452#M2966</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2019-12-23T16:22:29Z</dc:date>
    </item>
  </channel>
</rss>

