Hello Skyline Community,
I'm using a automation script where each night a lower priority alarm template is assigned to a configuration element, and in the morning the script activates the regular alarm template again.
However I want to assign this script to a large amount (300+) of elements, and the only way to do this is by manually creating dummies. Is there a way to assign a large amount of Configuration elements under a single dummy? Or maybe choose all elements under a dummy which use a specific alarm template?
Thank you
Hi Gijs,
You don't necessarily need an input dummy parameter to access elements from an Automation script. Instead, you can retrieve the required elements directly in code. For example:
var filter = new ElementFilter
{
ProtocolName = "Protocol Name",
ProtocolVersion = "Production",
};var elements = engine.FindElements(filter);
foreach (var element in elements.Where(e => e.RawInfo.AlarmTemplate == "..."))
{
element.SetAlarmTemplate("...");
}
Depending on your use case, there are other ways to retrieve elements as well. For example, if all relevant elements are grouped in a view, you can retrieve them as follows:
var elements = engine.FindElementsInView("View Name");
This approach avoids the need for a dummy parameter and gives you flexibility in selecting the elements you want to work with.
Hello Tom,
Thank you for your reply. I'm not the best in creating C# code and was hoping for a "GUI solution", but I'm going to give it a try.