Hello , I’m writing a C# automation script that uses the Class Library (
Skyline.DataMiner.Core.DataMinerSystem.Automation.
Skyline.DataMiner.Core.DataMinerSystem.Common
) to work with elements and views.
Each of our site has its own container view with several elements under it — and I’d like to automate the process of copying all elements from one site view to another.
Basically, I want to:
-
Get all elements under a specific container (e.g. “Japan”)
-
Duplicate them under another container or view (e.g. “Japan_Copy”) or multiple selection of elements using regex/string mapping and then move it to a new parent container
-
Keep the original elements untouched
-
Ideally preserve their configuration and historical data
Dragging and dropping 200+ elements manually isn’t very efficient, so I was wondering — can I safely use the Duplicate() method from the Class Library inside an automation script to do this, without losing historical data or trend info?
If not, is there another way to programmatically copy or reference existing elements into a new view while keeping their data?
Appreciate any pointers or examples from anyone who’s tried something similar
Hi,
Is it necessary to duplicate the elements? Keep in mind that a single element can be displayed across multiple views.
If that's not feasible, an alternative approach could be element replication (Replicating elements)
Hope it helps.
Hi,
Using the class library, you can create an element and make it available in multiple views. See below example:
https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryElementCreation.html#creating-an-element-in-specific-views
To update an existing element, see the below example:
https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryExamples.html#setting-a-property-and-renaming-the-element
The example is focused on element properties. In your case, you will need to update the element configuration to add another view:
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Core.DataMinerSystem.Common.ElementConfiguration.html
yeah basically i want that other element displayed another parent view aswell – is it possible to do it with a script rather than selecting edit and checking the box for each element ?