Hi Richard,
If you paste the code below into the VBA editor in Excel and run it you should get the data you are after in Excel. Please note that you have to have the diagram open in EA that you want the data for:
Sub diagramlist()
Set outputws = Worksheets("Sheet1")
outputws.Rows("2:" & Rows.Count).ClearContents
Dim repository As EA.repository
Set eaapp = GetObject(, "EA.App")
Set repository = eaapp.repository
Dim currentDiagram As EA.diagram
Set currentDiagram = repository.GetCurrentDiagram()
Dim diagramObjects As EA.Collection
Set diagramObjects = currentDiagram.diagramObjects
Dim diagramObject As EA.diagramObject
Dim Element As EA.Element
Dim j As Integer
j = 2
Dim k As Integer
Dim p As Integer
For i = 0 To diagramObjects.Count - 1
Set diagramObject = diagramObjects.GetAt(i)
Set Element = repository.GetElementByID(diagramObject.elementid)
Debug.Print currentDiagram.Name, Element.Type, Element.Name, Element.Notes
If Element.Type = "Class" Then
outputws.Cells(j, 1) = currentDiagram.Name
outputws.Cells(j, 2) = Element.Type
outputws.Cells(j, 3) = Element.Name
outputws.Cells(j, 4) = Element.Notes
k = 5
taggedvalues j, k, Element, outputws
j = j + 1
Attributelist j, k, Element, outputws
Else
End If
Next
End Sub
Sub taggedvalues(j As Integer, k As Integer, Element As Element, outputws As Worksheet)
Dim sourcetags As EA.Collection
Set sourcetags = Element.taggedvalues
For p = 0 To sourcetags.Count - 1
outputws.Cells(j, k + p) = sourcetags(p).Value
Next
End Sub
Sub Attributelist(j As Integer, k As Integer, Element As EA.Element, outputws As Worksheet)
Dim attributes As EA.Collection
Set attributes = Element.attributes
For p = 0 To attributes.Count - 1
Dim currentAttribute As EA.Attribute
Set currentAttribute = attributes.GetAt(p)
' outputws.Cells(j, 1) = currentDiagram.Name
outputws.Cells(j, 2) = currentAttribute.Type
outputws.Cells(j, 3) = currentAttribute.Name
outputws.Cells(j, 4) = currentAttribute.Notes
k = 5
taggedvaluesatt j, k, currentAttribute, outputws
j = j + 1
Next
End Sub
Sub taggedvaluesatt(j As Integer, k As Integer, currentAttribute As EA.Attribute, outputws As Worksheet)
Dim sourcetags As EA.Collection
Set sourcetags = currentAttribute.taggedvalues
For p = 0 To sourcetags.Count - 1
outputws.Cells(j, k + p) = sourcetags(p).Value
Next
End Sub
Cheers,
Rupert