Get path of parent folder

Get path of parent folder

Anonymous
Not applicable
1,159 Views
4 Replies
Message 1 of 5

Get path of parent folder

Anonymous
Not applicable

Is there a way to get the parent path for the current file? I know how to get the current path for the open model using iLogic, but I want to only get the path to the parent (E.g. File is in c:\folder1\folder 2\file.asd, and I want iLogic to return only c:\folder 1)

0 Likes
Accepted solutions (1)
1,160 Views
4 Replies
Replies (4)
Message 2 of 5

philip.G
Enthusiast
Enthusiast

It isn't really the answer you are looking for, but I would just manipulate the path inside the script. 😛

0 Likes
Message 3 of 5

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hi,

 

Dim a As New System.IO.DirectoryInfo("D:\Test\Old")
        a.GetDirectories()
        MsgBox(a.Parent.Name)
Dim fio As New System.IO.FileInfo("c:\folder1\folder 2\file.asd") 
        MsgBox(fio.DirectoryName)
        Dim a As New System.IO.DirectoryInfo(fio.DirectoryName) 
        a.GetDirectories()
        MsgBox(a.Parent.Name)

 

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 5

Anonymous
Not applicable

Perfect! Thanks

0 Likes
Message 5 of 5

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Your thanks are appreciated, and my pleasure to help you... 

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