Hi Ted,
Yes you can manage Project file using DesignProject Object. But it depends on what exactly you want to do?
Hi ted,
If the reply answers you query mark the topic as answered accept the answer.
This will help other new/returning users to find the solutions easily
My problem has always been that I have so many project files (several hundred) that Inventor is extremely slow when I go to switch projects from the open dialog. What I have finally done is write my own macro for switching projects, and it is much faster, but I have one caveat with it. Once I use this macro to switch projects, when I go to the open menu, the file directory is still in the previous project workgroup directory, and I have to click on the Workgroup folder under Workgroup Search paths in order to make the correct directory active. Not sure what I can add to my macro to make it switch the workgroup directory also?
Here is the code I am currently using (I also have another subroutine that uses BrowseFolders to get the project path and pass it to this function:
Public Sub SetActiveProject(FullProjectPath As String) ' from Inventor samples, but modified to be called with project path string to activate. ' Check to make sure a document isn't open. If ThisApplication.Documents.Count > 0 Then MsgBox "All documents must be closed before changing the project." Exit Sub End If ' Set a reference to the DesignProjectManager object. Dim oDesignProjectMgr As DesignProjectManager Set oDesignProjectMgr = ThisApplication.DesignProjectManager ' Show the current project. Debug.Print "Old active project: " & oDesignProjectMgr.ActiveDesignProject.FullFilename ' Get the project to activate ' This assumes that "C:\Temp\MyProject.ipj" exists. Dim oProject As DesignProject Set oProject = oDesignProjectMgr.DesignProjects.ItemByName(FullProjectPath) ' Activate the project oProject.Activate ' Show the current project after making the project change. Debug.Print "New active project: " & oDesignProjectMgr.ActiveDesignProject.FullFilename End Sub
Anyone have any tips how I can tell Inventor to look at the new workgroup path afterwards when I goto the Open dialog box?