Hello,
I want to get a list of only view names under a specific view from surveyor tab. Is there any engine methods that I can use to just get the view name not an element or service names under that view.
Thanks .
Just to add a small addendum to Jarno's answer
The GetViews method will return all views on the surveyor (i.e. all under the root view + root view)
If you just want the views under a specific one you can use the following snippet
IDms dms = engine.GetDms();
IDmsView parent = dms.GetView("Parent View Name");
IEnumerable<string> childViewNames = parent.ChildViews.Select(v => v.Name);
References:
Method GetView | DataMiner Docs
Hi,
You will need to include the following NuGets
https://www.nuget.org/packages/Skyline.DataMiner.Core.DataMinerSystem.Automation
https://www.nuget.org/packages/Skyline.DataMiner.Core.DataMinerSystem.Common
Perfect, It worked. Thank you
Thanks for you response.
I am getting an error ‘Engine’ does not contain definition for ‘GetDms’. I am using below snippet for testing:
class Script
{
public void Run(Engine engine)
{
IDms dms = engine.GetDms();
IDmsView parent = dms.GetView(“CP9000 Services”);
IEnumerable childViewNames = parent.ChildViews.Select(v => v.Name);
}
}