How to automatically find the current project folder(address) with ilogic?

How to automatically find the current project folder(address) with ilogic?

Anonymous
Not applicable
1,278 Views
6 Replies
Message 1 of 7

How to automatically find the current project folder(address) with ilogic?

Anonymous
Not applicable
 
0 Likes
Accepted solutions (2)
1,279 Views
6 Replies
Replies (6)
Message 2 of 7

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi MtigaM,

 

Here's an example.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim IPJ as String
Dim IPJ_Name as String
Dim IPJ_Path as String
Dim FNamePos As Long
'set a reference to the FileLocations object. 
IPJ = ThisApplication.FileLocations.FileLocationsFile
'get the location of the last backslash seperator 
FNamePos = InStrRev(ThisApplication.FileLocations.FileLocationsFile, "\", -1)     
'get the project file name with the file extension
IPJ_Name = Right(IPJ, Len(IPJ) - FNamePos) 
'get the project name (without extension)
IPJ_ShortName = Left(IPJ_Name, Len(IPJ_Name) - 4)
'get the path of the folder containing the project file
IPJ_Folder_Location = Left(ThisApplication.FileLocations.FileLocationsFile, Len(IPJ) - Len(IPJ_Name))

MessageBox.Show("Project Name: " & IPJ_ShortName _
& vblf & "Project File Name: " & IPJ_Name _
& vblf & "Project Path: " & IPJ_Folder_Location _
& vblf & "Project Path and File Name: " & ThisApplication.FileLocations.FileLocationsFile _
, "iLogic")

 

EESignature

Message 3 of 7

Anonymous
Not applicable

That's really helpful, thanks alot!

0 Likes
Message 4 of 7

Anonymous
Not applicable

one more question:

Is it possible to export the parts list to an excel template with ilogic? : )

Thanks again! 

0 Likes
Message 5 of 7

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi MtigaM,

 

Have a look at these links:

 

Includes exporting parts list to Excel:

http://inventortrenches.blogspot.com/2011/02/ilogic-code-for-parts-lists-title.html

 

Focuses on exporting parts list to an Excel template:

http://inventortrenches.blogspot.com/2011/06/ilogic-export-parts-list-with-options.html

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


EESignature

Message 6 of 7

Anonymous
Not applicable

Hi Curtis_Waguespack,

Im using Inventor 2010, and the parts list has to be exported as xls file, but my excel is 2007(xlsx).

Is later version of Inventor able to export parts list to xlsx files?

 

Thank you!

0 Likes
Message 7 of 7

Curtis_Waguespack
Consultant
Consultant

Hi MtigaM,

 

I don't think your version of Inventor can write out to an *.xlsx file. But you can use an *.xls file with Excel 2007 (it can read or write both). Just open your *.xlsx file and save it as a *.xls and you should be set.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


EESignature

0 Likes