Access to E/R Diagram informations

B

BB

Hi there,
I'm trying to access to some E/R diagram informations but I can't retrieve
annotations.
Statement Set attributeAnnotations = attributeElement.attributeAnnotations
in Sub enumAttributeAnnotations raises an error (it's in Italian and
translated is something like Invalid action for the object).
The column I'm accessing contains annotations.

Thanks,
Umberto



THE CODE:
-
Option Explicit


Sub showModel()

Static vme As New VisioModelingEngine

Dim models As IEnumIVMEModels

Set models = vme.models

Dim model As IVMEModel

Set model = models.Next

Call enumElements(model.elements)

End Sub

Sub enumElements(elements As IEnumIVMEModelElements)

Dim element As IVMEModelElement
Dim entityElement As IVMEEntity
Dim relationshipElement As IVMERelationship

Set element = elements.Next
Do While Not element Is Nothing
If element.Type = eVMEKindEREntity Then
Set entityElement = element
Debug.Print entityElement.Name

enumAttributes entityElement
'ElseIf element.Type = eVMEKindERRelationship Then
' Set relationshipElement = element
' Debug.Print relationshipElement.PhysicalName
'Else
' 'Debug.Print element.ElementID, element.Type
End If

Set element = elements.Next
Loop

End Sub


Sub enumAttributes(entity As IVMEEntity)

Dim attributeElement As IVMEAttribute
Dim attributes As IEnumIVMEAttributes
Set attributes = entity.attributes

Set attributeElement = attributes.Next()
Do While Not attributeElement Is Nothing
Debug.Print " " + attributeElement.Name,
attributeElement.DataType.ConceptualName
enumAttributeAnnotations attributeElement
Set attributeElement = attributes.Next()
Loop


End Sub


Sub enumAttributeAnnotations(attributeElement As IVMEAttribute)

Dim attributeAnnotations As IEnumIVMEAttributeAnnotations
Dim attributeAnnotation As IVMEAttributeAnnotation

Set attributeAnnotations = attributeElement.attributeAnnotations

Set attributeAnnotation = attributeAnnotations.Next()
Do While Not attributeAnnotation Is Nothing
Debug.Print " " + Format(attributeAnnotation)
Set attributeAnnotation = attributeAnnotations.Next()
Loop

End Sub
 
B

BB

PS: I'm not sure I need to access to that property. I'd like to read notes
in Entity, Attributes and Relationships but I can't find the way.

Umberto
 
S

Scot Becker

Those annotations aren't notes, they are for keys and etc.

The notes property for ER shapes is not exposed via the COM interface, so
you won't be able to get them.

Scot.
................................................
Scot Becker

Orthogonal Software
www.orthogonalsoftware.com

ORM Blog/Portal: www.objectrolemodeling.com

To e-mail me, please use my first name at the domain listed above. All mail
sent to the reply-to address gets routed to a junk e-mail folder where it
will likely be deleted without being read.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top