How to add a custom property in service creation via automation script and how to retrieve its value
Dear Apurva,
As far as I know, You can use the class library in your Automation script and can get/set the values.
https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryIntroduction.html
Example:-
https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryExamples.html
//Read
IDms myDms = engine.GetDms();
IDmsView myView = myDms.GetView("my View Name");
IDmsViewProperty myProperty = myView.Properties.SingleOrDefault(x => x.Definition.Name == "property name");
//write
IDms dms = protocol.GetDms();
IDmsElement element = dms.GetElement(new DmsElementId(346, 529981));
element.Name = "Renamed Element";
if (element.Properties["CustomProperty"].IsWritable)
{
IWritableProperty myProperty = element.Properties["CustomProperty"].AsWritable();
myProperty.Value = "A";
}
else
{
// "My Property" is a read-only property.
}
element.Update(); // Apply the changes.
Hi Apurva,
You can find this information in DataMiner Docs:
Hope it helps.
Thanks Miguel, but how to set the property value created from custom property?