<?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 Re: Why does this code fail when I refresh the file after move it? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637854#M12551</link>
    <description>&lt;P&gt;the ilogic run on the iam, that it is a part of , not the have been move. In may test the iam file was not check in to vault jet, but the file that was move was a check into vault&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 13:45:45 GMT</pubDate>
    <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
    <dc:date>2024-03-13T13:45:45Z</dc:date>
    <item>
      <title>Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12634252#M12548</link>
      <description>&lt;P&gt;I have a code that work fine on save .&amp;nbsp; But if I move a file and refresh the file&amp;nbsp; , It trigger the before save ilogic code and&amp;nbsp; it fail to run&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;ImportBOMCustomization&lt;/SPAN&gt;(&lt;SPAN&gt;sPathFile&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;If i do a&amp;nbsp; normal save. If work ok . why does it fail&amp;nbsp; &amp;nbsp;and is there a way to fix it without making Try Cathc as I have done in the code now&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub main()
	

Dim oDoc As Document = ThisDoc.Document

If oDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
	
Dim oADoc As AssemblyDocument = oDoc


Dim oBOM As BOM = oADoc.ComponentDefinition.BOM

Dim sPathFile As String = "C:\Working Folder\CAD\Kallesoe\Kallesoe iLogic\UpdateBOMSetup\BOMSetting.xml"
Try
oBOM.ImportBOMCustomization(sPathFile)

Catch
	Logger.Error("This fail when update files in iam after have move it in vault")

End Try

End Sub
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darkforce_the_ilogic_guy_0-1710229812205.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1336012i2512664E16C1C80B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darkforce_the_ilogic_guy_0-1710229812205.png" alt="Darkforce_the_ilogic_guy_0-1710229812205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 07:53:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12634252#M12548</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2024-03-12T07:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12635865#M12549</link>
      <description>&lt;P&gt;On which Event does the code run.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bradeneuropeArthur_0-1710268657865.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1336301i4AE73B2F86B9CD5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bradeneuropeArthur_0-1710268657865.png" alt="bradeneuropeArthur_0-1710268657865.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 18:37:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12635865#M12549</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2024-03-12T18:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12635892#M12550</link>
      <description>&lt;P&gt;Because the file is ReadOnly After moving Checkin to the Vault.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub main()
	
Dim oDoc As Document = ThisDoc.Document
Dim fio As New System.IO.FileInfo(oDoc.FullFileName)

If fio.IsReadOnly = False Then
	MsgBox ("nro")
If oDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
	
Dim oADoc As AssemblyDocument = oDoc
Dim oBOM As BOM = oADoc.ComponentDefinition.BOM

Dim sPathFile As String = "C:\Working Folder\CAD\Kallesoe\Kallesoe iLogic\UpdateBOMSetup\BOMSetting.xml"

oBOM.ImportBOMCustomization(sPathFile)

Else
MsgBox ("ro")
	Logger.Error("This fail when update files in iam after have move it in vault")
End If

End Sub&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Mar 2024 18:51:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12635892#M12550</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2024-03-12T18:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637854#M12551</link>
      <description>&lt;P&gt;the ilogic run on the iam, that it is a part of , not the have been move. In may test the iam file was not check in to vault jet, but the file that was move was a check into vault&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:45:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637854#M12551</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2024-03-13T13:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637929#M12552</link>
      <description>&lt;P&gt;Have a look at my first question about what event the code is in!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:12:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637929#M12552</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2024-03-13T14:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637981#M12553</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is before save document&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darkforce_the_ilogic_guy_1-1710340399637.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1336635i74F81DCD49F8A3C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darkforce_the_ilogic_guy_1-1710340399637.png" alt="Darkforce_the_ilogic_guy_1-1710340399637.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:33:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637981#M12553</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2024-03-13T14:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this code fail when I refresh the file after move it?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637990#M12554</link>
      <description>&lt;P&gt;This is the error that popup if I dont use the Try and Catch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darkforce_the_ilogic_guy_0-1710340547491.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1336636i91F92CB9A1641CDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darkforce_the_ilogic_guy_0-1710340547491.png" alt="Darkforce_the_ilogic_guy_0-1710340547491.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darkforce_the_ilogic_guy_1-1710340547515.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1336637iB32AB7F8D243FB99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darkforce_the_ilogic_guy_1-1710340547515.png" alt="Darkforce_the_ilogic_guy_1-1710340547515.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:35:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-does-this-code-fail-when-i-refresh-the-file-after-move-it/m-p/12637990#M12554</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2024-03-13T14:35:51Z</dc:date>
    </item>
  </channel>
</rss>

