Hi,
In automation, using ViewConfiguration(viewName, parentView) I am creating a view for Services I generate. Is there a way of assigning a Visio file to each new View?
Thanks,
Ross
Hi Ross,
If you are on an automation script, you should be able to use the following snippet of code
private static void TryUpdateVisioOnView(IEngine engine, IDmsView view, string visioFileName)
{
if (!visioFileName.EndsWith(".vsdx", StringComparison.OrdinalIgnoreCase) && !visioFileName.EndsWith(".vdx", StringComparison.OrdinalIgnoreCase))
{
visioFileName += ".vsdx";
}SetDataMinerInfoMessage message = new SetDataMinerInfoMessage
{
bInfo1 = Int32.MaxValue,
bInfo2 = Int32.MaxValue,
IInfo1 = Int32.MaxValue,
IInfo2 = Int32.MaxValue,
DataMinerID = -1,
ElementID = -1,
HostingDataMinerID = -1,
Sa1 = new SA(new[] { Convert.ToString(view.Id) }),
StrInfo2 = $"{visioFileName}|1|Active|False",
What = (int)NotifyType.VdxChangeViews
};engine.SendSLNetSingleResponseMessage(message);
}
You can replace the IDmsView object with the actual view ID if it is already available.
Disclaimer
As a rule, you should avoid using SLNet calls, as these are internal calls and are subject to change without notice. We recommend instead always using the correct UI or automation options provided in DataMiner Automation or through our web API.