Running Part's Rule

Running Part's Rule

ASchlaack
Collaborator Collaborator
683 Views
9 Replies
Message 1 of 10

Running Part's Rule

ASchlaack
Collaborator
Collaborator

In my assemboly I've got a part that has a rule. The rule controls a cut based on a skeletal parameter that changes. I made this rule:

 

iLogicVb.RunRule("LEG-BR", "Mitters")
iLogicVb.RunRule("LEG-FR", "Mitters")

iLogicVb.UpdateWhenDone = True

 to make the rule in those parts run. This rule has a evenet trigger placed on it:

 

triggers.PNG

but when I update a parameter the rule doesn't run. I know the above rule works because I can manually run it and it fires the rules it controls. Why won't it fire with the trigger?

 

AND my other question is:

 

In the parts themselves I also have triggers to run them based from the over in the skeleton I'm changing BUT they also will only run when I manually run them. They have the same triggers attached to them as the one above.

 

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Accepted solutions (3)
684 Views
9 Replies
Replies (9)
Message 2 of 10

ASchlaack
Collaborator
Collaborator

ADDED: I DIDN'T MEAN TO HAVE "IPROPERTY CHANGE" IN TRIGGERS, BUT IT STILL DOESN'T WORK.

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 3 of 10

Vladimir.Ananyev
Alumni
Alumni

Could you please confirm that the following checkbox is set?

Rules Triggered by Events dialog.png

 

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 4 of 10

ASchlaack
Collaborator
Collaborator
Yes it is.
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 5 of 10

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

“Any Model Parameter Change” event could fire your rule only if some model parameter was changed (not user or linked parameter ).

That’s why I prefer more flexible control.  It is illustrated by the attached simple skeleton-driven assembly.  Open the assembly document and run the iLogic form to change skeleton model parameters.  Two components derive Length and Width parameters from the Skeleton.ipt. Each component has its own rule that executes on Length and Width changes during the top assembly update cycle.  “Any Model Parameter Change” event is not involved

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 6 of 10

ASchlaack
Collaborator
Collaborator

Cool, I understand what you mean. Thank you. One questio nyou just gave me though that isn't quite related is in your part "Disk" you have this rule

 

iLogicVb.UpdateWhenDone = True
trigger = Width
MessageBox.Show("DISK:  run Update rule", "iLogic")

Does the trigger mean that it will run this rule whenever whatever trigger equals is changed?

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 7 of 10

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

What is important here is the blue-colored Width variable.  Any change in the blue parameter value initiates this rule execution.  You may use any combination of “blue” parameters for this purpose.  For example, in the Ring.ipt I used the sum of Length and Width.

You may use the combination of very different parameter types (lengths, angles, texts, etc.):

trigger = CStr(Length) & CStr(Width) & CStr(MyTextParameter) & CStr(Angle)

Any “blue” participant will fire this rule execution. So you are free to implement any logic.

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 8 of 10

ASchlaack
Collaborator
Collaborator

Just making sure I understand I'd liike to dumb what you said down a bit... Anything following "trigger=" that is blue will cause this trigger to happen when they change correct?

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 9 of 10

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

Yes, you are correct.  If the "blue" parameter changes, this rule will be executed.

Sometimes this "automatic" execution is not desired. In this case you may use Parameter("d0") function instead of "blue" names ( here d0 is the parameter name).


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 10 of 10

ASchlaack
Collaborator
Collaborator

Thank you very much for your time and help.

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes