The goal is to assign a visio file (.vdsx) to an element, via protocol.
I found the NotifyType(444) /*NT_ASSIGN_ELEMENT_VDX */
...which appears to do what I want, but I cannot find how to make it work.
Hi Guilherme,
Following up on the comment you made here to Miguel's answer, you should be able to use
- CreateElementFileMessage call to create the visio file properly (named Element_[dmaId]_[elemId].vdsx)
- GetInfoMessage with the Type VdxFileChangeInfo to retrieve the last change time if you want to double check it has been updated (see screenshot at the bottom of the answer)
- UpdateElementActiveVisioMessage to set the visio to the element
Hi Guilherme,
There was a similar question but related to scripts:
Assigning a visio to an element through script
Hope it helps.
I’m using the SLNet call UpdateElementActiveVisioMessage already. However, it doesn’t work solely. First I need to call the CreateElementFileMessage to create the visio file properly (named Element_[dmaId]_[elemId].vdsx), and then use the UpdateElementActiveVisioMessage with that new visio file. This is not perfect, since I need to track down when the new file is synced before executing the last call. In any case, we are always advised not to use SLNet Calls, so I was trying to avoid them.
There should be no need for a Notify message to do this. Specifically, for a protocol visio, you should be able to use the UpdateProtocolActiveVisioMessage message. Make sure to fill in the protocol name and the name of the visio file you uploaded to the right location (likely with CreateProtocolFileMessage) in an earlier step.
Is the UpdateProtocolActiveVisioMessage equivalent to the Notify 444?
From the name, it seems that one assigns the “global” protocol visio that applies to all elements while the Notify mentioned in the question refers to assigning a Visio just to one specific element.
The question specifically mentioned assigning the visio through the protocol. For assigning a specific element visio, there is also a message, which is UpdateElementActiveVisioMessage.
The notify message may read like it assigns to an element, but it’s a legacy message, so I’m pretty sure it assigns to a protocol as well (since assigning to a specific element has not existed for that long yet).
Indeed, I’m already using the UpdateElementActiveVisioMessage, together with the CreateElementFileMessage to make this work. However, we are always advised not to use SLNet calls, so I was trying to avoid them. Also, if there is no other option, what do you think would be the best way to acknowledge the visio file is synced so the UpdateElementActiveVisioMessage can be executed afterward, and not before.
I would say NotifyType is the worse of the 2 evils though. Not sure if you have ever gotten advise on the use of those messages?
Your question about the upload… Does the “CreateProtocolFileMessage” not send a response?
The CreateElementFileMessage does send a response – an error code.
I don’t believe it accounts for the sync, because on the customer – which has a heavily loaded DMS – I need to Sleep() between this call and the UpdateElementActiveVisioMessage to make it work properly. Without the Sleep(), it does not “find” the file.
That’s it!