Vb.Net - Get project file path

Vb.Net - Get project file path

premysl.misun
Advocate Advocate
3,806 Views
5 Replies
Message 1 of 6

Vb.Net - Get project file path

premysl.misun
Advocate
Advocate

Hi,

 

how I can get in Vb.net directory path of active project file (.ipj) in Inventor 2019?

 

I want to create some folders in directory of active project file and I do not know how.

 

Thank you for you answers.

 

P.

0 Likes
Accepted solutions (1)
3,807 Views
5 Replies
Replies (5)
Message 2 of 6

R.Mabery
Advocate
Advocate
Accepted solution

I believe this is what you are looking for:

 

InvApp.DesignProjectManager.ActiveDesignProject.WorkspacePath

Thanks,
Randy Mabery
Applications Expert
IMAGINiT Technologies
0 Likes
Message 3 of 6

bradeneuropeArthur
Mentor
Mentor

this is what you need:

 

Public Sub main()
Dim a As Application
Set a = ThisApplication

Dim b As FileOptions
Set b = a.FileOptions

MsgBox b.ProjectsPath
End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 6

NachoShaw
Advisor
Advisor

Hey

 

I made this as a button to open my project folder to save me browsing for it. Hope it helps

 

Sub ProjectFolder()

    Dim oFileLocations As FileLocations
    Set oFileLocations = ThisApplication.FileLocations

            Dim FolderPath As String
            FolderPath = oFileLocations.Workspace
        
            Shell "explorer.exe" & " " & FolderPath & "", vbNormalFocus
            
                     
        End Sub

Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 5 of 6

JBerns
Advisor
Advisor

@NachoShaw ,

 

Thanks for the useful code. I offer the following suggestion:

FolderPath = oFileLocations.Workspace & "\"

This ends the path with a backslash.

Otherwise, Explorer tries to open the folder as a file. That is what I experienced with Window 10. Perhaps this is not needed in earlier Windows versions.

 

 

Regards,

Jerry

 

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 6 of 6

p.sangeetaKZZMH
Explorer
Explorer

Hi Randy sir,

 

When i use the same line of code in Electrical, I am getting below error

 

: 'Public member 'DesignProjectManager' on type 'IAcadApplication' not found.'

 

0 Likes