Extending product function with VBA > Samples > Diagram_AddItemsAtLocation
  
Diagram_AddItemsAtLocation
Sub Diagram_AddItemsAtLocation()
Dim dgm As Diagram
Dim defExpObj As Definition
Dim defDS As Definition

Set dgm = SA2001.Encyclopedia.GetCurrentDiagram
If dgm Is Nothing Then
MsgBox "no diagram"
End If

Set defExpObj = SA2001.Encyclopedia.GetDefinitionById(1146) ' an example id - find one from your own encyclopedia
dgm.AcceptDropOfObjectAt defExpObj, 1, 1

Set defDS = SA2001.Encyclopedia.GetDefinitionById(1093) ' an example id - find one from your own encyclopedia
dgm.AcceptDropOfObjectAt defDS, 1, 500

dgm.AcceptDropOfTypeAt 3, 5, 1, 1500 ' data element
End Sub
See also
AcceptDropOfObjectAt
AcceptDropOfTypeAt
Samples