<?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 Apprentice vs Full Inv API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5493128#M120478</link>
    <description>&lt;P&gt;Hi I wonder if anyone could shed some light on a small issue I am experiencing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what I need to do is extract the current Workspace path and current Project Name during my external application load event. So I am also trying to make the application not reliant on Inventor running in the background so I opted for using apprentice. The problem is that apprentice does not quite work that well when trying to get this information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the full Inventor API&amp;nbsp;then all works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Get current project file info
            Dim oInvApp As Inventor.Application = Nothing
        Try
            oInvApp = Marshal.GetActiveObject("Inventor.Application")
            strWorkspacePath = oInvApp.FileLocations.Workspace
            strWorkspaceName = oInvApp.DesignProjectManager.ActiveDesignProject.Name
        Catch
            
        End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using apprentice like this then it does not actually retrieves&amp;nbsp;the last active project info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Get current project file info
        Dim oInvApp As New Inventor.ApprenticeServerComponent
        Try            
            strWorkspacePath = oInvApp.FileLocations.Workspace
            strWorkspaceName = oInvApp.DesignProjectManager.ActiveDesignProject.Name
        Catch
            
        End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is the procedure I am following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start Inventor&lt;/P&gt;&lt;P&gt;Current project =&amp;nbsp;"Project A" with workspace "c:\temp\A"&lt;/P&gt;&lt;P&gt;I then activate&amp;nbsp;&lt;SPAN&gt;"Project B" with workspace "c:\temp\B"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I run my app with full Inventor API I get the correct info.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I run my app with using apprentice I get project A's info&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why would this be happening? Its almost like the app has not updated the registry with the new active project information??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Feb 2015 14:00:32 GMT</pubDate>
    <dc:creator>Raider_71</dc:creator>
    <dc:date>2015-02-03T14:00:32Z</dc:date>
    <item>
      <title>Apprentice vs Full Inv API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5493128#M120478</link>
      <description>&lt;P&gt;Hi I wonder if anyone could shed some light on a small issue I am experiencing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what I need to do is extract the current Workspace path and current Project Name during my external application load event. So I am also trying to make the application not reliant on Inventor running in the background so I opted for using apprentice. The problem is that apprentice does not quite work that well when trying to get this information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the full Inventor API&amp;nbsp;then all works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Get current project file info
            Dim oInvApp As Inventor.Application = Nothing
        Try
            oInvApp = Marshal.GetActiveObject("Inventor.Application")
            strWorkspacePath = oInvApp.FileLocations.Workspace
            strWorkspaceName = oInvApp.DesignProjectManager.ActiveDesignProject.Name
        Catch
            
        End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using apprentice like this then it does not actually retrieves&amp;nbsp;the last active project info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Get current project file info
        Dim oInvApp As New Inventor.ApprenticeServerComponent
        Try            
            strWorkspacePath = oInvApp.FileLocations.Workspace
            strWorkspaceName = oInvApp.DesignProjectManager.ActiveDesignProject.Name
        Catch
            
        End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is the procedure I am following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start Inventor&lt;/P&gt;&lt;P&gt;Current project =&amp;nbsp;"Project A" with workspace "c:\temp\A"&lt;/P&gt;&lt;P&gt;I then activate&amp;nbsp;&lt;SPAN&gt;"Project B" with workspace "c:\temp\B"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I run my app with full Inventor API I get the correct info.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I run my app with using apprentice I get project A's info&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why would this be happening? Its almost like the app has not updated the registry with the new active project information??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2015 14:00:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5493128#M120478</guid>
      <dc:creator>Raider_71</dc:creator>
      <dc:date>2015-02-03T14:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Apprentice vs Full Inv API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5494926#M120479</link>
      <description>&lt;P&gt;Great question Pieter,&lt;/P&gt;
&lt;P&gt;I'm sure the current project is saved to the registry because I tested using the Task Scheduler and that found the current project file.&lt;/P&gt;
&lt;P&gt;I have asked one of the developers, hopefully they will come back to me.&lt;/P&gt;
&lt;P&gt;In the meantime I will do some testing.&lt;/P&gt;
&lt;P&gt;Jon.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:13:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5494926#M120479</guid>
      <dc:creator>Jon.Dean</dc:creator>
      <dc:date>2015-02-04T16:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Apprentice vs Full Inv API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5521075#M120480</link>
      <description>&lt;P&gt;Hi Raider_007,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you checked the 2015 API Object Model; see below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/155775iEBFFE260E27EC220/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2015_Api.png" title="2015_Api.png" /&gt;&lt;/P&gt;
&lt;P&gt;Here you can see where the project path is defined.&lt;/P&gt;
&lt;P&gt;Jon.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2015 10:51:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/apprentice-vs-full-inv-api/m-p/5521075#M120480</guid>
      <dc:creator>Jon.Dean</dc:creator>
      <dc:date>2015-02-26T10:51:11Z</dc:date>
    </item>
  </channel>
</rss>

