Run iLogic Rule for all Parts in Assembly

Run iLogic Rule for all Parts in Assembly

Anonymous
Not applicable
4,756 Views
9 Replies
Message 1 of 10

Run iLogic Rule for all Parts in Assembly

Anonymous
Not applicable

I Created an iLogic Rule that sets up some parameters.

I want to Automaticaly opens each and every Part in my assembly, run this Rule,  and then save it without me havig to do so manually.

 

Please advise.

 

Thanks,

Yoni

0 Likes
4,757 Views
9 Replies
Replies (9)
Message 2 of 10

MegaJerk
Collaborator
Collaborator

I’ve wanted to do the same thing, and when I found this: http://inventortrenches.blogspot.com/2011/08/built-for-speed-running-ilogic-rules.html I thought that it would answer all of my dreams. Sadly, when  you have an assembly open, it doesn’t actually seem to cycle through all of the parts inside of that assembly and apply the rules that you have assigned to fire off on .ipt files, individually, which makes it the opposite of useful.

 

Perhaps someone more awesome could take that concept and turn it into a real proper workhorse.



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
0 Likes
Message 3 of 10

Anonymous
Not applicable
Yes,
I checked the above add-in before posting my request. I even used it a couple of times. But having to open and save hundreds of parts had kid a set me off this solution. I feel there has to be a better way...
0 Likes
Message 4 of 10

MjDeck
Autodesk
Autodesk

Yoni,

 Do you want to add the rule to each part permanently?  Or do you only want to run it once?
 If you only want to run it once, can you post the rule?  It probably has to be modified so it will run in the assembly and modify the parts.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 5 of 10

MegaJerk
Collaborator
Collaborator

Hey MjDeck. When Yoni Gaia posts the rule, could you show us how to do it both ways? I started a previous topic about trying to figure out how to create a rule using the API, but no one has replied.

Thanks! 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
0 Likes
Message 6 of 10

MjDeck
Autodesk
Autodesk

Could you post a link to your previous topic?  Or start a new one and post the link here.  It would help to keep the topics focused.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 7 of 10

MegaJerk
Collaborator
Collaborator

Link is here : http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Adding-iLogic-Rule-Using-the-API/m-p/3...

 

Thank you for any insight you can shed! 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
0 Likes
Message 8 of 10

Anonymous
Not applicable

Hi Mike,

To answer your question, I only want to run the rule once on all parts.

The ilogic rule is irrelevant, but I attached it any way.

I want to be able to refer to an external iLogicVb file that I can modify every now and then.

 

Regards,

Yoni

 

0 Likes
Message 9 of 10

MjDeck
Autodesk
Autodesk

Here's a modified version of your rule.  It will run on all parts in an assembly (using Document.AllReferencedDocuments).  It can also still be run on a single part.  Notice that the code to set the iProperty value at the end is changed so that it modifies the part instead of the assembly.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 10 of 10

Anonymous
Not applicable

why this attached piece is not working, i want to create thickness width length in iproperties and apply values extracted from rangebox.

 

Best regards,

Sachin

0 Likes