- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I wonder if anyone could shed some light on a small issue I am experiencing.
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.
If I use the full Inventor API then all works fine.
'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
When using apprentice like this then it does not actually retrieves the last active project info.
'Get current project file info
Dim oInvApp As New Inventor.ApprenticeServerComponent
Try
strWorkspacePath = oInvApp.FileLocations.Workspace
strWorkspaceName = oInvApp.DesignProjectManager.ActiveDesignProject.Name
Catch
End Try
So here is the procedure I am following:
Start Inventor
Current project = "Project A" with workspace "c:\temp\A"
I then activate "Project B" with workspace "c:\temp\B"
If I run my app with full Inventor API I get the correct info.
If I run my app with using apprentice I get project A's info
Why would this be happening? Its almost like the app has not updated the registry with the new active project information??
Thanks.
Solved! Go to Solution.
