Is it possible to create a list of buttons somehow? Ideally I would like to have a window with as many buttons as elements for a specific driver. I do not know before hand how many buttons I will need. So somehow I need a way to create this in a dynamic fashion.
I should be able to catch the button.pressed event for each button as well.
Hi Jon,
Pretty similar solution to João, but maybe a bit more fleshed out can be found here: https://github.com/SkylineCommunications/SLC-AS-Example_InteractiveAutomationScriptToolkit/tree/main/IAS_DynamicButtonList_1
Hi Jon,
You should be able to use the Interactive Automation Script Toolkit NuGet together with Class library NuGet to achieve what you are after.
Have a look at this snippet Interactive Automation Script with One Button per Element (github.com) and you can adapt it to suit your needs.
Instead of getting all the elements, you could filter them by protocol name and/or version with the help of the element.Protocol property.
Instead of generating an information event, you could pass a lambda function with the right arguments to a method of your choice.
If you store the elements in a local variable you could even find back the original object and perform operations on top of it.
Thank you Joao. Your answer was extremely helpful. I combined both your insight with Thomas’ to come up with my solution. Thanks for your help.
Thanks Thomas! That was exactly what I was looking for. Hope this can help somebody else who needs to implement the same use case in the future.