Accessing iLogic sub assy rules from master assembly

Accessing iLogic sub assy rules from master assembly

Anonymous
Not applicable
938 Views
5 Replies
Message 1 of 6

Accessing iLogic sub assy rules from master assembly

Anonymous
Not applicable

Happy Friday all,

   Hope everyone has a great weekend. Sorry if this question seems familiar, not sure I asked it properly before, but here goes.

Is it possible to access and use iLogic rules contained in sub assemblies from the top level assembly and if so how? So this is what I have. I have an assembly model of an aluminum dump trailer (just the body) comprised of the following sub assemblies. The floor, driven by an iLogic rule that controls the length, the bulkhead, driven by a rule that controls the height, the left and right sides (1 ea.) driven by rules that control length, height, and style (smooth side, posted side) I will also have other side options that will be controlled by the top level assembly iLogic rules. The tailgate driven by a rule that controls height and style (regular gate, or barn door gate and which side the hinge is located) and lastly the hoist box driven by a rule that controls height.

   So do I need to copy/paste all the iLogic code into the top level assembly (doable) or can it be accessed directly from the top level assembly already somehow through the sub assemblies. I don't remember seeing anything like this done in any of the online tutorials I've watched. Looking forward to any and all comments even if they are over my head like the roof. So thanks in advance for your time and help.

   Again, I hope you all have a great weekend.

 

 

Frank

 

Inventor 2016

0 Likes
Accepted solutions (1)
939 Views
5 Replies
Replies (5)
Message 2 of 6

NSBowser
Advocate
Advocate

Frank,

 

There is a way to do what you are asking and it is as simple as adding a rule in your Assembly to run one of the rules within it's components (sub-assy or part)

 

iLogic Snippets -> Run other -> "RunRule In Component"

iLogicVb.RunRule("PartA:1", "ruleName")

Simply specify the 'Browser Node Name' for the component and the Name of the Rule within that component.

 

That all being said. This is not a workflow I would recommend everyone use often. I can see a few cases where the work is already done and it is prohibitive to redistribute the code in a way to avoid applying this technique, but in most cases I would think that the code could be better placed elsewhere.

 

Either way, I hope this snippet gets you up and running as you need.


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 3 of 6

Anonymous
Not applicable

NSBowser,

   Thanks for the response. Hope you had a great weekend. I tried your suggestion and finally got the syntax correct but not sure how this helps me. I'm not driving a single part with my rule, but a sub assembly. Well 6 sub assemblies to be exact. Your solution loads the rule but not the form that uses the rule.

Example: 1st Sub assembly is the floor. In the floor I have 1 rule called "Floor Length" for this rule I have a form that drives this sub assembly models length and also allows me to select options that depend on which tailgate that will be used in the top level assembly. So I use this form to select 2 options for the floor sub assembly.

   So in my top level assembly my first line in my rule reads:

iLogicVb.RunRule("AD Floor:1", "Floor Length")

 When I click "OK" I get no errors but when I go to create a form to use this rule, I'm not finding the rule. So it would seem I am still missing a piece of this puzzle. I feel like I'm missing something really simple.

   It's looking like I will need to combine the code from my sub assemblies into a rule in my top level assembly. Does that sound about right?

 

Frank

0 Likes
Message 4 of 6

NSBowser
Advocate
Advocate

As far as I am aware, you cannot show the sub-components form directly from the assembly.

 

I was also unable to find a programming work around for this. I attempted opening specific sub-components which had rules triggered on open to show their forms, but the functionality did not work when opened programmatically  The thought was it would loop through the parts that needed updating, open them, where you would be presented with the forms to fill out for each save and close and you would be done. However... that didn't work.

 

The best thing I can suggest is to duplicate the parameters and functionality of the individual forms in the assembly (I could see making a form with multiple tabs, one for each of the subs) and then simply pass the entered parameters down to the sub-components. You would maintain the functionality in both places. The only draw back besides the duplication of effort would be that changes made in the sub-components alone would not migrate back up to the assembly form, so you might not be able to utilize the duplicity anyhow.

 

Again, I'm not certain I fully understand what all is going on in your process workflow well enough to say this is what you SHOULD be doing. Only that you can do it as I have described, if you choose.

 

 

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 5 of 6

Anonymous
Not applicable

Hey all,

      just wanted to let everyone know that I got things worked out. As it turns out, I needed all the rules in the sub assemblies to make things work properly in the top level assembly. The code (rule) in the top level assembly uses the rules in the subs to drive the assembly. It's probably easier to show, so I'll post a video to show how everything works. Still have lots of details to work out, but this is a huge step forward. Thank you to all of you who helped me work this out, and happy hump day!

 

 

Frank

Inventor 2016

0 Likes
Message 6 of 6

Anonymous
Not applicable
Accepted solution

So here is the video of the top level assembly, hope this helps...

0 Likes