Extending product function with VBA > Samples > Diagram_AddItems
  
Diagram_AddItems
Sub Diagram_AddItems()
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.AcceptDropOfObject defExpObj

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

dgm.AcceptDropOfType 3, 5 ' data element
End Sub
See also
AcceptDropOfObject
AcceptDropOfType
Samples