@tjvz85 wrote:
Thanks @Curtis_Waguespack ,
I will check out the try/catch route in the meantime, but this still requires the parameters to be present in the file. Can I take it as fact that this must be the case, or do you think there is way to emulate those two parameters with code? Like an array for the Parts_Files_List and a option for the Action_List.
Let me know once you had a chance to look at your Global Batch Form.
Thanks for the advise
Hi @tjvz85
You're correct, the controls in the ilogic forms require parameters as their basis, so unfortunately there is not a way to emulate the controls without having the parameters in the file like we can with for instance VBA forms.
... buttons use rules as their basis, so what I do is create a refresh rule/button to create the parameters needed for the other controls...
Within the rules that are used as the button there is the Try/Catch that creates the needed parameters.
So for a global form, the buttons are external rules, and the external rules contain the try/catch statements that create the needed parameters locally
If you look at the batch tool .ipt file attached in this thread and delete the two parameters ( Parts_Files_List and Action_List ) from that part file, and then open the form you will see a strike through the parameters in the form, this is how the global version of this form would appear when first opened too:

If you click the Select Part Files button, it will run the rule called Select Part Files which contains two try/catch statements that will "refresh" the file and form by creating the needed parameters.
' Get the active document. Assumes a part document is active.
Dim partDoc As PartDocument
partDoc = ThisApplication.ActiveDocument
' Get the UserParameters collection
Dim userParams As UserParameters
userParams = partDoc.ComponentDefinition.Parameters.UserParameters
'check for parameter and create if not found
Try
oTest = Parameter("Part_Files_List")
Catch
'multi-value text parameter
userParams.AddByValue("Part_Files_List", "< No Files >", UnitsTypeEnum.kTextUnits)
End Try
Parameter.Param("Part_Files_List").IsKey = True
Try
oTest = Parameter("ActionList")
Catch
'multi-value text parameter
userParams.AddByValue("ActionList", "Copy All Custom Parameters", UnitsTypeEnum.kTextUnits)
MultiValue.SetList("ActionList", "Copy All Custom Parameters", "Delete All Custom Parameters")
End Try
'more code here....
So really this batch tool file has everything it needs to be made a global form already, but the rules would need to be made external rules and then the buttons recreated to use those external rules.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com