I want to create a folder \Export in the folder above my current working directory.
How do I manipulate the path in order to go one folder up.
For example: C:\path\Drawings\Inventor
to:
C:\path\Drawings\Export
Dim oPath As String = System.IO.Path.GetDirectoryName(oDoc.FullFileName) Dim oFolder As String = oPath & "\Export" If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Give this a try:
Imports System.IO
Dim oFolder As String = System.IO.Path.GetDirectoryName(ThisDoc.Document.FullFileName)
Dim oParentFolder = Directory.GetParent(oFolder).FullName
Dim oNewFolder As String = oParentFolder & "\Export"
If Not System.IO.Directory.Exists(oNewFolder) Then
System.IO.Directory.CreateDirectory(oNewFolder)
End If
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Can't find what you're looking for? Ask the community or share your knowledge.