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 .
Hi,
This is available in the Skyline.DataMiner.Core.DataMinerSystem.Common nuget, through the following method: Method GetViews | DataMiner Docs. All of the nuget packages we officially support are listed here: Skyline NuGet packages | DataMiner Docs.
You can consume NuGet packages in your Visual Studio protocol or Automation script solution by going to the NuGet Package Manager, searching for existing NuGets and installing them.
I have made a small example available. You can find it here: https://github.com/SkylineCommunications/SLC-AS-GetViews
Catalog Example: SkylineCommunications_SLC-AS-GetViews | Catalog
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
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);
}
}
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 your response. It was really helpful.