Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change the project file

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
2741 Views, 4 Replies

Change the project file

How can we change(open) the Project file(ipj) with inventor api using vb.net code?

Tags (1)
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

The following is right out of the API Help.  The code assumes that the project is already in the lsit of available projects.  If it is not then you will need to add it with the DesignProjects.AddExisting() method.

 

Public Sub SetActiveProject()
    ' 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("C:\temp\MyProject.ipj")

    ' Activate the project
    oProject.Activate

    ' Show the current project after making the project change.
    Debug.Print "New active project: " & oDesignProjectMgr.ActiveDesignProject.FullFileName
End Sub
 


Message 3 of 5
Anonymous
in reply to: Anonymous

Hi Robert ,  Thanks a Lot.....  Working fine.....Smiley Happy

Message 4 of 5
warrentdo
in reply to: Anonymous

This may be a shot in the dark but you know more about code than me!

Would it be possible to open a named version of inventor with a named project file outside of inventor in the windows environments?

 

Regards

Warren.

Message 5 of 5
projetech
in reply to: warrentdo

personal , how do I open a project specifying the path using C # ? hugs Alessandro Ferraz 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report