Extending product function with VBA > Samples > Diagram_Explorer_AddItem
  
Diagram_Explorer_AddItem
Sub Diagram_Explorer_AddItem()
Dim def As Definition
Dim dgm As Diagram
Dim dgm2 As Diagram
Dim dgmtoref As Diagram
Dim sym As Symbol
Dim symtoref As Symbol
Dim lret As Long

Set def = SA2001.Encyclopedia.GetDefinitionById(1146) ' an example id - find one from your own encyclopedia
If def Is Nothing Then
MsgBox "no definition"
Exit Sub
End If
Set dgm = SA2001.Encyclopedia.GetCurrentDiagram
If dgm Is Nothing Then
MsgBox "no diagram"
End If
If Not dgm.saTYPE = GTEXPLORER Then
MsgBox "not an explorer diagram"
End If

Set dgmtoref = SA2001.Encyclopedia.GetDiagramById(830) ' an example id - find one from your own encyclopedia

Set dgm2 = SA2001.Encyclopedia.GetDiagramById(2351)
Set symtoref = dgm2.GetSymbolById(2365)

Set sym = dgm.CreateSymbolForExplorerDiagram(def)
sym.Save
Set sym = dgm.CreateSymbolForExplorerDiagram(symtoref)
sym.Save
Set sym = dgm.CreateSymbolForExplorerDiagram(dgmtoref)
sym.Save
End Sub
See also
CreateSymbolForExplorerDiagram
Samples