Rule to be triggered every time its assembly is saved

Rule to be triggered every time its assembly is saved

AMN3161
Advocate Advocate
492 Views
6 Replies
Message 1 of 7

Rule to be triggered every time its assembly is saved

AMN3161
Advocate
Advocate

Hello

 

I am having difficulty having a external rule that will live in a part to be triggered every time a assembly that contains that part is saved, it whether that be a part in a normal assembly or a part that is a few sub assemblies down. 

 

i building a rule to update BOM information by doing a excel look up, this will be used by a few people and i want one external rule to do everything. Other wise i would just have a rule at the assembly level to trigger all rules of a specific name to be run and set the trigger to be a save. 

 

Is this possible?

0 Likes
493 Views
6 Replies
Replies (6)
Message 2 of 7

AMN3161
Advocate
Advocate

Would me just setting the rule to be triggered before being check in work? If i cant just depend on saving at the top level assembly work?

0 Likes
Message 3 of 7

Anonymous
Not applicable

You could set an Event Trigger up to run the rule "Before Save"

 

@ClintBrown3D Autodesk Inventor 479.png

Although that might be a bit of  pain if your code is slow, maybe run it on close.

0 Likes
Message 4 of 7

AMN3161
Advocate
Advocate

That is what i was thinking originally but i don't know when saves happens in assembly components when you are saving in the top level assembly.

 

Lets say i am working with a ball valve for example. i put the code into the valve to trigger before a save. Then i am working in the top level assembly and the valve is in a pipe run a few sub-assemblies down. If i save the top level assembly before checking it in, does a save trigger in every part of a assembly?

0 Likes
Message 5 of 7

AMN3161
Advocate
Advocate

I am trying to make this as simple as possible from the user perspective so the people not so savvy with a inventor wont find this rule intrusive. I want the user to just go into the part and link it to a external rule and forget about it. I have the rule doing everything i need without needing any custom properties, i am just trying to figure out a trigger that will happen passively in the background as the user is working

0 Likes
Message 6 of 7

Anonymous
Not applicable

Have a look at the options, you can choose to set it up in a top-level assembly only -  under "This Document" (as shown in my image:) This does mean that you would need to do it on all top-level assemblies, but it is a pretty good workaround.

0 Likes
Message 7 of 7

Anonymous
Not applicable

You could have an "enabling parameter" or iProperty to identify the top-level assemblies, which a user could select, that way the rule would run and exit if the file was not marked as top-level for example.

If TopLevel = False Then
	Return : End If

 

0 Likes