Use iLogic change the part filename when "Place iLogic Component"

Anonymous

Use iLogic change the part filename when "Place iLogic Component"

Anonymous
Not applicable

I'd like to set the filename of the part by iLogic when place iLogic Component into an assemblly.

 

For example place an screw with iLogic code and set the iLogic component by thread size and length as the filename.

 

any idea?

 

Thanks!

 

 

 

0 Likes
Reply
1,214 Views
11 Replies
Replies (11)

b_sharanraj
Advocate
Advocate

hi @Anonymous

 

You cannot change the File Name while inserting iPart in Assembly because you are accessing the file.

 

The File name of the iPart is none other than Member Column of each row. So change the Member Column in your iPart file and Generate files or start inserting it in assembly 🙂

 

image.png

 

Regards

B.Sharan Raj

0 Likes

MechMachineMan
Advisor
Advisor

Are you placing these components using the COMMAND - "Place iLogic Component", or are you using code to insert the parts?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes

Anonymous
Not applicable
Hi MechMachineMan,

I am using command "Place iLogic Component"

0 Likes

Anonymous
Not applicable

Did you ever get an answer on this?

0 Likes

scottmoyse
Mentor
Mentor

I'm quite surprised this question hasn't come up more often. It would be great to see a solution. 


Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

bradeneuropeArthur
Mentor
Mentor
Use the postprivateevent in the commandmanager!

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

scottmoyse
Mentor
Mentor
I think the main issue is, Inventor creates and saves the file before the Place iLogic form appears. I'll give this a go though and see if I can figure it out. Thanks.

Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

0 Likes

scottmoyse
Mentor
Mentor

@bradeneuropeArthur wrote:
Use the postprivateevent in the commandmanager!

Thanks, based on what you've just shared, I've found this article. 

https://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html

 

Which looks like it might do the trick 


Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

scottmoyse
Mentor
Mentor

@bradeneuropeArthur wrote:
Use the postprivateevent in the commandmanager!

@bradeneuropeArthur which method of PostPrivateEvent were you suggesting to use? Because iFileNameEvent doesn't set the filename of the new file about to be created by the Place iLogic Component command, instead it's passing the filename of the file to use to execute the command. 


Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

0 Likes

bradeneuropeArthur
Mentor
Mentor
try this:

Private Sub MyFileUserInputEvents_OnPopulateFileMetadata(FileMetadataObjects As Inventor.ObjectsEnumerator, Formulae As String, Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles MyFileUserInputEvents.OnPopulateFileMetadata

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

scottmoyse
Mentor
Mentor

@bradeneuropeArthur wrote:
try this:

Private Sub MyFileUserInputEvents_OnPopulateFileMetadata(FileMetadataObjects As Inventor.ObjectsEnumerator, Formulae As String, Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles MyFileUserInputEvents.OnPopulateFileMetadata

Are you suggesting to use this in a VB macro? Or from within an iLogic rule inside the template part being placed with the iLogic Place Component command? Presumably some of those things are variables which you have set but not shared the code for? the code kinda looks malformed as you have shared it. 


Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature


RevOps Strategy Manager at Toolpath. New Zealand based.

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

0 Likes