DiagramLinks says
SourceInstanceUID : String - Returns the Unique Identifier of the source object.
TargetInstanceUID : String - Returns the Unique Identifier of the target object.
And when debugging the script I printed out some IDs and GUIDs
selectedElement id = 505 guid={EB58D0E1-1B80-4db2-AAD4-C2CBBC3B5C0C}
diagramLink ConnectorID=458 SourceInstanceUID=859B351F
Looking at the UID output... what's that?
There is nothing in
Repository to get something by UID, only by Guid or ID.
Repository.GetElementByGuid
Repository.GetElementByID
I'm trying to write a script that takes selected elements and then to change the line style of the element's connectors.
SelectedObjects returns DiagramObjects which only knows about the Element via ElementID, it doesn't know anything about the connectors.
From Repository.GetCurrentDiagram.SelectedObjects and locating the element via Repository.GetElementByID(selectedObject.ElementID) I can get at the Connectors but not the DiagramLinks for those connectors.
Iterating over Repository.GetCurrentDiagram.DiagramLinks gives me SourceInstanceUID and TargetInstanceUID but as noted above those values dont appear useful. I can check whether the DiagramLinks.ConnectorID is in the selectedElement.Connectors Collection, but this seems rather roundabout.
So, should I be using UIDs?
Is there a more direct what than all the indirection I have mentioned.