Hi,
I want to get the assigned Visio file for each of my Views. I can see this in the View's general properties, 'Visio File:' but I can't seem to find a method to retrieve it in the help file.
I've seen in docs an IDmsView declaration but I can't get any script in my DMS using it to validate. I think I might need to add a .Library dll reference but i'm not sure.
Is there an engine method to retrieve this value?
Thanks,
Ross
Hi Ross,
To answer the first part of your question, you should be able to use the interface and properties described in this help page Interface IDmsView more specifically the Property Properties for the custom properties but at the present time that does not include the assigned Visio file name.
For the Visio file name you can use the following SLNet call should work for the Visio file
private static string GetVisioFileName(IEngine engine, IDmsView view)
{
var request = new GetInfoMessage(InfoType.ViewInfo);
var responses = engine.SendSLNetMessage(request).OfType<ViewInfoEventMessage>();var viewInfo = responses?.FirstOrDefault(r => r.ID == view.Id);
return viewInfo?.VdxFileName;
}
This should work for your use case but I do have to add a disclaimer here that these kinds of SLNet calls are internal calls and typically not recommended to use since there is no official support and may be subject to change in the future.
Regarding the second part of your question, you must include the reference to the Class Library in your script.
The easiest way would be to develop your script inside Visual Studio and add the NuGet Package for Class Library.
See Skyline.DataMiner.Core.DataMinerSystem.Automation and Skyline.DataMiner.Core.DataMinerSystem.Common
Edited as per the comment of Jens
Hi Jens, you are correct.
I misunderstood the question from Ross and thought it was about all properties in general.
Indeed it is currently not possible to retrieve the assigned Visio file name from within the IDmsView object
Updated the answer to now include an SLNet call that is capable of retrieving the Visio file name
Also created an internal task to add out-of-the-box support for this in the future.
Great, thanks Joao.
João, please correct me if I’m wrong, but I don’t think that the current Class Library does support getting the visio which is assigned to a certain view?