I am trying to create a user-defined class diagram collection by looping through the diagrams attached to use cases but I am getting an error I can't resolve:
I get a run time error of: "Object variable or With block variable not set".
I know that the reference to the diagram within the use cases' diagrams collection is valid. The problem seems to be isolated to the classdiagramcollection's ADD method.
Script excerpt below
Dim classdiagrams As ClassDiagramCollection
Dim cd As ClassDiagram
Dim ucc As UsecaseCollection
Dim uc As UseCase
' Use Cases
Set ucc = OModel.GetAllusecases ()
' Get all the class diagrams attached to use cases
For i = 1 To ucc.count
' Skip use cases without class diagrams
If ucc.getat(i).ClassDiagrams.count > 0 Then
' loop through the class diagrams in that use case
For j = 1 To ucc.getat(i).ClassDiagrams.count
' **** PROBLEM IS ON THE FOLLOWING LINE ***
Pinned topic Class Diagram Collection Add Method Error
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2006-03-15T14:58:26Z at 2006-03-15T14:58:26Z by SystemAdmin
SystemAdmin 110000D4XK3659 Posts
Re: Class Diagram Collection Add Method Error2006-03-15T14:58:26ZThis is the accepted answer. This is the accepted answer.One of my co-workers found the problem.
The classdiagramCollection needs to be instantiated/initialized using a line of code such as:
Set classdiagrams = New ClassDiagramCollection