Rather than fiddling directly with the table you should create diagram object with the according EA.DiagramObject class. This will allow to add element to the Diagram.DiagramObjects collection.
q.
Thanks for that, but I'm still struggling, so I looked to Section 5.9 which defines the class, including variables:
Position: Bottom, Top, Left, Right etc which can, at this stage, be any default values.
Also the Diagram_ID and the Element_ID, both of which I have derived from parsing the xml generated by my SQL queries.
My problem arises when I now turn to Section 3.7.3 and I just can’t see how to use what I know in the context you’ve shown it.
Although in my case the diagram and the element both already exists, whereas you're creating new.
I think the vb code should look like:
Dim objDsplyNew as EA.DiagramObject
objDsplyNew.Left = 400 : objDsplyNew.Right = 440
objDsplyNew.Top = -100: objDsplyNew.Bottom = -150
objDsplyNew.ElementID = intSourceID ‘an integer value e.g. 1071 telling it what element to drop
objDsplyNew.DiagramID = intTargetID ‘an integer value e.g. 83 telling it on which diagram to drop it
objDsplyNew.Update() ‘making it happen
My instinct is that somewhere in there needs to be an ‘AddNew’ command but I can’t understand how it should be phrased when the element being added is new only to this diagram, though I suppose it is a new line in the DiagramObjects collection ...
Thank you again.