Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

File name/Part name match through iLogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
donnie.morris
771 Views, 2 Replies

File name/Part name match through iLogic

What is a simple way to make the "File" name and "Part number" match using iLogic?

2 REPLIES 2
Message 2 of 3

Depends from what context (from assembly, from part, on save?). The filename is harder to change so I would match the part number to the filename.


You can change the part number to the filename for the active document wiht the following line:

 

iProperties.Value("Project", "Part Number") = ThisApplication.ActiveDocument.FullFilename

 

This will use the FULL filename, so including directory and extension. If you just want the filename you can use:

 

iProperties.Value("Project", "Part Number") = System.IO.Path.GetFileNameWithoutExtension(ThisApplication.ActiveDocument.FullFilename)
Contact me for custom app development info@basautomationservices.com. Follow below links to view my Inventor appstore apps.

Free apps: Smart Leader | Part Visibility Utility | Property Editor | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle


Message 3 of 3

TY i was struggling creating iparts and publishing them to library because every size change, deleted the partname propiety, this is a great shortcut when you are a filename na*zi like me . !

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

Post to forums  

Autodesk Design & Make Report