Hi,

Just a small scripting problem that I could use some help with.

I have obtained a script that colours my classes depending upon 
the stereotype, (See Below).

Can someone help me out by telling how to extend this script to 
colour all Rose model items with the same stereotype, not just 
classes?

Thankyou in advance,

Les.

Sub Main
      Begin Dialog UserDialog ,,216,187,"Set Color for 
Stereotype"
      OKButton 172,12,40,14
      CancelButton 172,32,40,14
      Text 8,116,12,8,"R",.Text1
      Text 8,132,12,8,"G",.Text2
      TextBox 24,116,36,12,.TextBox1
      TextBox 24,132,36,12,.TextBox2
      OptionGroup .OptionGroup1
      OptionButton 8,56,56,8,"Red",.OptionButton1
      OptionButton 8,68,56,8,"Green",.OptionButton2
      OptionButton 8,80,56,8,"Blue",.OptionButton3
      OptionButton 8,100,188,8,"Manual Set (Enter the RGB 
values in the boxes below):",.OptionButton4
      Text 8,40,64,8,"Color:",.Text3,,,ebBold
      Text 8,4,56,8,"Stereotype:",.Text4,,,ebBold
      TextBox 8,16,136,12,.TextBox3
      Text 8,148,12,8,"B",.Text5
      TextBox 24,148,36,12,.TextBox4
      End Dialog
      

      Dim theCats As CategoryCollection
      Dim theCat As Category
      Dim ClassDiags As ClassDiagramCollection
      Dim ClassDiag As ClassDiagram
      Dim theClassViewCollection As ClassViewCollection
      Dim theClasses As ClassCollection
      Dim theClass As Class
      Dim MyDialog As UserDialog

      result = Dialog(MyDialog)
      ctrl = MyDialog.OptionGroup1

      If MyDialog.TextBox3 = "" Then
      MsgBox "No stereotype specified"
      Exit Sub
      End If

      Set theCats = RoseApp.CurrentModel.GetAllCategories

      For i=1 To theCats.Count
      Set theCat = theCats.GetAt(i)
      Set ClassDiags = theCat.ClassDiagrams

      For j = 1 To ClassDiags.Count
              Set ClassDiag = ClassDiags.GetAt(j)
              For k = 1 To ClassDiag.GetClasses.Count
                      Set theClass = ClassDiag.GetClasses.GetAt
(k)

      If theClass.Stereotype = MyDialog.TextBox3 Then
                      
      If ctrl = 0 Then
      ClassDiag.GetClassView(theClass).FillColor.Red = 256
      ClassDiag.GetClassView(theClass).FillColor.Green = 0
      ClassDiag.GetClassView(theClass).FillColor.Blue = 0
              End If

      If ctrl = 1 Then
      ClassDiag.GetClassView(theClass).FillColor.Red = 0
      ClassDiag.GetClassView(theClass).FillColor.Green = 256
      ClassDiag.GetClassView(theClass).FillColor.Blue = 0
              End If

      If ctrl = 2 Then
      ClassDiag.GetClassView(theClass).FillColor.Red = 0
      ClassDiag.GetClassView(theClass).FillColor.Green = 0
      ClassDiag.GetClassView(theClass).FillColor.Blue = 256
              End If

      If ctrl = 3 Then
      ClassDiag.GetClassView(theClass).FillColor.Red = 
MyDialog.TextBox1
      ClassDiag.GetClassView(theClass).FillColor.Green = 
MyDialog.TextBox2
      ClassDiag.GetClassView(theClass).FillColor.Blue = 
MyDialog.TextBox4
              End If



      End If
      Next k
      Next j
      Next i
      MsgBox "Done"

End Sub

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe rose_forum
*************************************************************************

Reply via email to