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: 

Add folder above current working folder folder using iLogic

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Daniel_Gerssen
132 Views, 1 Reply

Add folder above current working folder folder using iLogic

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

 

1 REPLY 1
Message 2 of 2

Hi @Daniel_Gerssen 

 

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.

Post to forums  

Technology Administrators


Autodesk Design & Make Report