I have a rule in the top assembly to update & want to run this as a final 'clean up' after various rules have run in sub assembly parts.
I have a rule within a part at the end of the line. I want this rule to goto the top assembly & run the 'Update' rule.
Could someone please provide an example of how this rule should be applied?
Thanks
MES
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
There might be another way to do it, other than running the top-level rule from the part.
But the following should work. It takes advantage of the fact that the top-level assembly is the ActiveDocument.
If (ThisApplication.ActiveDocument Is ThisDoc.Document) Then Return
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("Arg1", "Arg1Value")
auto = iLogicVb.Automation
auto.RunRuleWithArguments(ThisApplication.ActiveDocument, "ruleName", map)
Thanks for the reply.
I don't understand map.Add("Arg1", "Arg1Value").
The top rule is called "Update" - changed "ruleName" to Update - resulting in:
If (ThisApplication.ActiveDocument Is ThisDoc.Document) Then Return
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap() map.Add("Arg1", "Arg1Value") auto = iLogicVb.Automation auto.RunRuleWithArguments(ThisApplication.ActiveDocument, "Update", map)
& found these errors:
Rule Compile Errors in Update, in Hex Head Bolt.ipt
Error on Line 3 : End of statement expected.
Error on Line 4 : Name 'map' is not declared.
Error on Line 6 : Comma, ')', or a valid expression continuation expected.
Cheers
Andrew
Looks like there was a copy-and-paste problem in the post.
I attached a new version of the rule in a text file. This one doesn't have map.Add. It sounds like you don't need that. map.Add allows you do send an argument (for instance a number or an option) as input to the other rule.