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: 

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

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
1043 Views, 6 Replies

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

 
6 REPLIES 6
Message 2 of 7
Curtis_Waguespack
in reply to: Anonymous

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")

 

Message 3 of 7
Anonymous
in reply to: Anonymous

That's really helpful, thanks alot!

Message 4 of 7
Anonymous
in reply to: Curtis_Waguespack

one more question:

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

Thanks again! 

Message 5 of 7
Curtis_Waguespack
in reply to: Anonymous

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


Message 6 of 7
Anonymous
in reply to: Curtis_Waguespack

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!

Message 7 of 7
Curtis_Waguespack
in reply to: Anonymous

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


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report