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: 

Run iLogic Rule for all Parts in Assembly

9 REPLIES 9
Reply
Message 1 of 10
YoniGaia
3695 Views, 9 Replies

Run iLogic Rule for all Parts in Assembly

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

9 REPLIES 9
Message 2 of 10
MegaJerk
in reply to: YoniGaia

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
Message 3 of 10
YoniGaia
in reply to: YoniGaia

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...
Message 4 of 10
MjDeck
in reply to: YoniGaia

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.

Message 5 of 10
MegaJerk
in reply to: YoniGaia

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
Message 6 of 10
MjDeck
in reply to: MegaJerk

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.

Message 7 of 10
MegaJerk
in reply to: MjDeck

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
Message 8 of 10
YoniGaia
in reply to: MjDeck

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

 

Message 9 of 10
MjDeck
in reply to: YoniGaia

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.

Message 10 of 10
sachinkhartude
in reply to: MjDeck

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

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

Post to forums  

Autodesk Design & Make Report