File name/Part name match through iLogic

File name/Part name match through iLogic

donnie.morris
Enthusiast Enthusiast
1,122 Views
2 Replies
Message 1 of 3

File name/Part name match through iLogic

donnie.morris
Enthusiast
Enthusiast

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

0 Likes
Accepted solutions (1)
1,123 Views
2 Replies
Replies (2)
Message 2 of 3

basautomationservices
Advocate
Advocate
Accepted solution

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 | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle | Property Editor Pro


Message 3 of 3

jerez.diseno
Explorer
Explorer

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 . !

0 Likes