Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

ThisDoc.Path but up one level

Anonymous

ThisDoc.Path but up one level

Anonymous
Not applicable

I have some stand alone Ilogic driven models and drawings. These can be placed within any inventor project the designer chooses.

 

When working as a stand alone model using its own project path I can output the drawing using ThisDoc.WorkspacePath. However, if it is placed within another project and the drawing opened and exported with that particular project the problem I have with ThisDoc.WorkspacePath is that the folder structure could be different depending on the project the designer chooses to use.

 

To get around this I wish to use ThisDoc.Path however with my folder structure the template drawings folder (which contains the drawings which use this code) is on the same level as the exported drawing folder so ThisDoc.Path cannot see the exported folder because it is 1 level up.

 

Is there a way to use ThisDoc.Path but to go up a folder level?

 

Thanks in advance.

 

Reply
Accepted solutions (1)
829 Views
2 Replies
Replies (2)

matt_jlt
Collaborator
Collaborator
Accepted solution
This returns the parent directory for a folder. so your example should be
Dim newPath As String = System.IO.Directory.GetParent(ThisDoc.Path).ToString)

If that doesn't work you can try using the code below.
Dim newPath As String = (ThisDoc.Path.Substring(0, ThisDoc.Path.LastIndexOf("\")))

Regards, Matt.

Anonymous
Not applicable

Hello 

 

similarly i am also having some standard standalone drawing templates.

 

Those standalone models i will import by means of iLogic import option  ,whenever i import suddenly respective drawing will configure to the new sister model and it will be saved to working folder of the project. 

 

If you have any codes in this context please suggest

 

Kiran  

0 Likes