<?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 Vb.net - Export files and then can not change project in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7404351#M97762</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my own program in vb.net to export drawings to pdf and dxf files, and part (or assembly) to stp files. It works very good (from opened drawing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I export one or more drawings by this, I can not change project and I have to close Inventor and start it again. Message from invenor is "Active project can not be changed, if are open files in Inventor" (I have in czech language, so that message can be little different). But all files in Inventor are vissibly closed (after export program closed drawing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea to solved this in vb.net?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Premek&lt;/P&gt;</description>
    <pubDate>Sun, 24 Sep 2017 10:40:17 GMT</pubDate>
    <dc:creator>premysl.misun</dc:creator>
    <dc:date>2017-09-24T10:40:17Z</dc:date>
    <item>
      <title>Vb.net - Export files and then can not change project</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7404351#M97762</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my own program in vb.net to export drawings to pdf and dxf files, and part (or assembly) to stp files. It works very good (from opened drawing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I export one or more drawings by this, I can not change project and I have to close Inventor and start it again. Message from invenor is "Active project can not be changed, if are open files in Inventor" (I have in czech language, so that message can be little different). But all files in Inventor are vissibly closed (after export program closed drawing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea to solved this in vb.net?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Premek&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 10:40:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7404351#M97762</guid>
      <dc:creator>premysl.misun</dc:creator>
      <dc:date>2017-09-24T10:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.net - Export files and then can not change project</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7404357#M97763</link>
      <description>&lt;P&gt;Here is part of program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim path As String = System.IO.Path.GetDirectoryName(soubor.FullFileName)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path2 As String = System.IO.Path.GetFileNameWithoutExtension(soubor.FullFileName)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path3 As String = System.IO.Path.GetFileName(soubor.FullFileName)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; soubor.SaveAs("D:\Projekty\Dokumentace\Pdf\" &amp;amp; path2 &amp;amp; ".pdf", True)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; soubor.SaveAs("D:\Projekty\Dokumentace\Dxf\" &amp;amp; path2 &amp;amp; ".dxf", True)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDrawDoc As DrawingDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDrawDoc = _invApp.ActiveDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oRefDoc As Document&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oRefDoc In oDrawDoc.ReferencedDocuments&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim model As Inventor.PartDocument = _invApp.Documents.Open(path &amp;amp; "\" &amp;amp; path2 &amp;amp; ".ipt", False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model.SaveAs("D:\Projekty\Dokumentace\Stp\" &amp;amp; path2 &amp;amp; ".stp", True)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _invApp.ActiveDocument.Close()&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf oRefDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sestava As Inventor.AssemblyDocument = _invApp.Documents.Open(path &amp;amp; "\" &amp;amp; path2 &amp;amp; ".iam", False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sestava.SaveAs("D:\Projekty\Dokumentace\Stp\" &amp;amp; path2 &amp;amp; ".stp", True)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _invApp.ActiveDocument.Close()&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next oRefDoc&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 10:45:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7404357#M97763</guid>
      <dc:creator>premysl.misun</dc:creator>
      <dc:date>2017-09-24T10:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.net - Export files and then can not change project</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7538723#M97764</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do anybody now how to "unlock" change of project after file export?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 10:18:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7538723#M97764</guid>
      <dc:creator>premysl.misun</dc:creator>
      <dc:date>2017-11-13T10:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.net - Export files and then can not change project</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7540476#M97765</link>
      <description>&lt;P&gt;It seems fairly obvious that it is one of 2 things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. There is a bug.&lt;/P&gt;
&lt;P&gt;2. You still have files open - probably invisibly, which still prevents file change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you run the rule, either check in the bottom right corner of your main window. There should be 2 boxes with numbers in. If both are not 0, you definitely have documents open. The other option is to check the application Documents enum using VBA to see the open documents count.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have documents open invisibly, you will need to revise your original export code to close the files after you are done exporting them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;** Modify your code to contain&amp;nbsp;&lt;/P&gt;
&lt;P&gt;oRefDoc.Close AND model.Close inside of your loop. your _invApp.ActiveDocument is not doing a sufficient job of closing files - and will not close an invisible file, which is opened when using Documents.Open(,False)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 20:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vb-net-export-files-and-then-can-not-change-project/m-p/7540476#M97765</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-13T20:30:10Z</dc:date>
    </item>
  </channel>
</rss>

