Hi:
I have a button in a mimic shared and used by multiple VIEWs. I can configure the button to trigger an Automation script. And I can use [this view] place holder in the mimic to pass the view name to the script. However, I 'd like to also pass one of the view properties to the automation script. How do I do it?
Thanks
Hi Miao,
You can do this by using the property placeholder.
I did a quick test where the placeholder is used in the shape data that triggers my automation script
You can retrieve the property of a view using the following code (note that I only added the bare minimum so make sure you also have exception handling in place):
var dms = engine.GetDms();
var viewName = Convert.ToString(engine.GetScriptParam("viewName"));
var view = dms.GetView(viewName);
var viewProperty = view.Properties["propertyName"];
engine.Log("View Property: " + viewProperty);
This makes use of the Class Library as the engine object does not contain methods to retrieve view info. An introduction to using the Class Library can be found in this video.
Thank you very much for the response. I am trying to use the class library in my c# code in my dataminer automation script action. But when i try to using the namespace the automation script gives me error saying Library not exist in Skyline.DataMiner namespace. Seems it need assembly reference. Where could i find the .dll file for this? and how could i import the .dll file?
In my automation script C# code I use:
using Skyline.DataMiner.Library.Common;
using Skyline.DataMiner.Library.Automation;
Thank you very much.
Hi,
I don't think it's possible to directly pass the property of the view. By passing the name (or id) of the view, you can then easily retrieve any property from the view in the automation script itself.
may I have an example of getting the view property using the C# code in auto script? thank you very much.
I added more details in a separate answer as it’s easier to format.
Thanks for the help