hiho,
Sequence diagrams
are under either packages or use cases. You can walk all the packages and
use cases and then check all their scenario repsective diagrams. Something
like this should get you started:
Sub
Main
Dim uc
As UseCase
For i% = 1 To RoseApp.CurrentModel.GetAllUseCases.Count
Set uc = RoseApp.CurrentModel.GetAllUseCases.GetAt(i%)
For j% = 1 To uc.ScenarioDiagrams.count
ProcessDiagram uc.ScenarioDiagrams.GetAt(j%)
Next j%
Next i%
Dim cat As Category
For i% = 1 To RoseApp.CurrentModel.GetAllCategories.Count
Set cat = RoseApp.CurrentModel.GetAllCategories.GetAt(i%)
For j% = 1 To cat.ScenarioDiagrams.count
ProcessDiagram cat.ScenarioDiagrams.GetAt(j%)
Next j%
Next i%
End Sub
For i% = 1 To RoseApp.CurrentModel.GetAllUseCases.Count
Set uc = RoseApp.CurrentModel.GetAllUseCases.GetAt(i%)
For j% = 1 To uc.ScenarioDiagrams.count
ProcessDiagram uc.ScenarioDiagrams.GetAt(j%)
Next j%
Next i%
Dim cat As Category
For i% = 1 To RoseApp.CurrentModel.GetAllCategories.Count
Set cat = RoseApp.CurrentModel.GetAllCategories.GetAt(i%)
For j% = 1 To cat.ScenarioDiagrams.count
ProcessDiagram cat.ScenarioDiagrams.GetAt(j%)
Next j%
Next i%
End Sub
The only issue this
leaves is that the ScenarioDiagrams lists have both sequence and collaboration
diagrams. In many common usages of Rose, this gets you various semantic
duplicates. If, per your message, you really only want sequence diagrams
and no collaboration diagrams, you'll have to check the diagram type in the
awkward manner shown below:
Sub
ProcessDiagram(diag As ScenarioDiagram)
Const SEQUENCE = 1
Const COLLABORATION = 2
Const SEQUENCE = 1
Const COLLABORATION = 2
If
diag.GetDiagramType = SEQUENCE Then
' Do whatever
Viewport.Open
Print diag.Name
End If
' Do whatever
Viewport.Open
Print diag.Name
End If
End
Sub
------
b
--
Brian G. Lyons
Number Six Software - Voted Rational's Best Complementary Service Provider
1101 30th St, NW, Suite 500
Washington, DC 20007
http://www.numbersix.com
Brian G. Lyons
Number Six Software - Voted Rational's Best Complementary Service Provider
1101 30th St, NW, Suite 500
Washington, DC 20007
http://www.numbersix.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
Sent: Monday, December 04, 2000 8:22 AM
To: [EMAIL PROTECTED]
Subject: (ROSE) finding diagrams in rosehello,
i have the following problems:
i have to write an add-in, which searches the model for diagrams (especially sequence-diagrams!). as sequence-diagrams could belong to packages, i want to check each package of the model, if it has one or more sequence-diagrams. but i could not find any method like "diagrams" or "getalldiagrams"!!!
could someone tell me how i can find all these diagrams??? (i do not know them by id or name!!)
michael
