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: 

Automating file names using a common project number

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
vancem
350 Views, 4 Replies

Automating file names using a common project number

We have a number of templates for common parts within our projects. We need to include the project no (4-6 digets) as a suffix for each file name.

example 100x10 FLT, 300Lg - 3841-5

 

My question is how is the best way to set the project no. as a paramater that i can call up in each part, assembly, drawing ect.

Do I link it through an exel spreed sheet, or do I creat a base part and link all other items to that part?

Or is there a better way.

 

Thanks 

 

Vance

4 REPLIES 4
Message 2 of 5
VdVeek
in reply to: vancem

It's posible to use the Project name as a parameter. You can use this iLogic Rule manual or automaticly.

 

' Set a reference to the DesignProjectManager object.
Dim oDesignProjectMgr As DesignProjectManager
oDesignProjectMgr = ThisApplication.DesignProjectManager
'Set Project property to Active Project Name 
iProperties.Value("Project", "Project") = oDesignProjectMgr.ActiveDesignProject.Name

When you place this Rule as an Internal or an External iLogic rule in each Template file (Part/idw/assy) and add an 'New Document' Event Trigger to it. When you create a new document in your active project the Project Propertie is changed to the name of the active Project.

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 3 of 5
vancem
in reply to: VdVeek

Rob,

 

Thanks for that. I can get it to work I would like to manipulate the text to assign only the first 7 characters of our project name this is the code im using.

Our project name is "3841-5 - KNIFE GATE DESIGN" this is typical of our naming convention. I would like to assign "3841-5" only to the  

iProperties.Value("Project", "Project")
The code below only returns the first character "3"
Any help would be greatly appreciated.

Regards

Vance

 

SyntaxEditor Code Snippet

' Set a reference to the DesignProjectManager object. 
Dim oDesignProjectMgr As DesignProjectManager 
oDesignProjectMgr = ThisApplication.DesignProjectManager 

oNAME = oDesignProjectMgr.ActiveDesignProject.Name 
MessageBox.Show(oNAME, "Title") 

oNAMEshort = (Left(oNAME(False),7))
MessageBox.Show(oNAMEshort, "Title")

iProperties.Value("Project", "Project") = oNAMEshort
Message 4 of 5
VdVeek
in reply to: vancem

Change the Left command to:

 

oNAMEshort = (Left(oNAME,7))
Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 5 of 5
vancem
in reply to: VdVeek

Works beautifully Thanks

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

Post to forums  

Autodesk Design & Make Report