Hi,
I need to retrieve the element in my Automation Script. I have its IP address. There are a number of documented methods for finding elements using name, id, view etc, but is there a way to find the element using its IP address?
Hi Trong,
You can do this by using DMS_GET_ELEMENT_ID_FROM_IP (76).
Hi Trong, have you tried by adding using Interop.SLDms;?
Hi Trong,
I believe there is not a specific method that you could use to get an element based on the IP address. However, you could proceed as follows:
// Get all the elements in the cluster (Root view = -1)
Element[] lElements = engine.FindElementsInView(-1);// Get Element based on polling IP
Element myElement = lElements.Where(element => element.PollingIP == "10.11.12.13").First();if (myElement != null)
{
engine.GenerateInformation("Element name=" + myElement.ElementName);
}
Thanks Miguel. This solution works also.
Thanks Jen. This works well.
However, for me it works inside a protocol QAction. When using it inside an Automation Script I get “namespace name ‘DMS’ could not be found” error in the Logs. Not sure why.