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
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