This is a add-in that allows for multiple buttons to act as iLogic Rule triggers. No need for a single trigger.
Creating command buttons can be done at any time and when an Inventor file is loaded two rules are automatically looked for and executed. AddButtons stored in the open file and an external rule named AddGlobalButtons.
After installation copy the file ilxPanelBar.vb from the installation directory to your iLogicAdd (or any directory you use to store external rules in.) Add the rule file to iLogics list of External Rules in Files.
To Use, add a rule to your document named 'AddButtons'. Below is sample text of a rule.
Code:
AddVbFile "ilxPanelBar.vb"
Sub Main
ilxPanelBar = ilxPanelBarVB.GetPanelBar(ThisDoc.Document, ThisApplication)
ixPanelBar.AddButton("buttonName", "Button Text", "RuleName", ThisDoc.Document, "", False)
End Sub
AddButton(buttonName, buttonText, RuleName, Document, [PanelGroup, IsExternalRule])
buttonName: Name of button. Must be unique in each group. No spaces or punctuation in name.
buttonText: Text label displayed on the button.
RuleName: Name of the rule to fire when button is pressed.
Document: ThisDoc.Document
PanelGroup: Optional. Group to place button in. If not supplied or empty then button is place in default document group.
ExternalRule: Optional. True or False value indicating if the rule is an external rule.
Sample with multiple groups:
Code:
AddVbFile "ilxPanelBar.vb"
Sub Main
ilxPanelBar = ilxPanelBarVB.GetPanelBar(ThisDoc.Document, ThisApplication)
ilxPanelBar.AddButtonGroup("groupName", "Group Title", ThisDoc.Document)
ilxPanelBar.AddButton("btnName", "New Button 1", "Rule01", ThisDoc.Document, "groupName")
End Sub
Adds a button to the group "Group Title" to the documents button panel.
Try out the iLogic PanelBar and leave comments, suggestions, requests.
Thanks