Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Generic C# template to parse all of the elements in a single view

Solved508 views27th September 2024#C#class automion script backup
1
Syeda Ayesha128 21st May 2024 2 Comments

A generic C# template to parse all of the elements in a single view and compare it with a protocol , and pass the matched item to another script.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 27th September 2024
Marieke Goethals [SLC] [DevOps Catalyst] commented 26th August 2024

I see that this question has been inactive for some time. Do you still need help with this? If not, could you select the answer (using the ✓ icon) to indicate that the question is resolved?

Marieke Goethals [SLC] [DevOps Catalyst] commented 27th September 2024

As this question has now been inactive for a long time, I will close it. If you still want more information, could you post a new question?

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
João Severino [SLC] [DevOps Catalyst]13.01K Posted 21st May 2024 2 Comments

Hi,

You should be able to use Skyline’s Class Library to achieve something aligned with what you describe here.

After installing the NuGet package you should be able to do something similar to the snippet below

var dms = engine.GetDms(); // or protocol.GetDms() if in a protocol QAction
var view = dms.GetView(“MyViewName”);
var elements = view.Elements;
foreach (var element in elements)
{
if (element.Protocol.Name == “MyProtocol” && element.Protocol.Version == “1.0.0.1”)
{
// do something
}
}

Additionally, if you want to also have the elements not only in the specified view but also in child views you can repeat the process above with the following

var childViews = view.ChildViews;

References:

Method dms.GetView | DataMiner Docs

Interface IDmsView | DataMiner Docs

For calling a subscript from another script you can use an example similar to the one found on this docs page Method PrepareSubScript | DataMiner Docs together with the Method SelectScriptParam | DataMiner Docs.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 27th September 2024
Syeda Ayesha commented 22nd May 2024

Hi Joao, Thankyou so much for your answer, much appreciated , could you please explain a bit further that how would i pass parameter in the protocol.get function viewid.get function

João Severino [SLC] [DevOps Catalyst] commented 22nd May 2024

Hi Syeda,
Not sure if I understand your follow-up question correctly but based on your other question (https://community.dataminer.services/question/c-template-a-loop-to-trigger-a-button-on-a-device-based-on-protocol/) you should be able to call your logic in a script and then from within a script use the GetScriptParam method (https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Automation.Engine.GetScriptParam.html)
With it, you would now have your input parameters as strings and could use them to replace the snippets above where I have the “MyViewName”, “MyProtocol” and “1.0.0.1” placeholders.

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs