Here's a simple example of a script that may help you
get started. It add's a note to the current active
with the name of the diagram. Not sure how you
could program author, reviewer, last reviewed into
the script. As far as last updated, I guess you
could look at the timestamp on the file, see online
help, script function: FileDateTime. Also don't know
about triggering this on a new diagram, there is
OnNewModelElement, but using this would put you into
a loop (adding the note would trigger it again).
To use it, add a menu item
to call this script (see below) then go to the diagram,
and execute this script.
'add note with text to current (active) diagram
Sub Main
Dim diag As Diagram
Dim note As NoteView
Set diag = RoseApp.CurrentModel.GetActiveDiagram()
If diag Is Nothing Then
MsgBox "No active diagram"
Exit Sub
End If
qName$ = diag.name
Set note = Diag.AddNoteView(qName$, 2)
note.YPosition = 200
note.XPosition = 1000
'Print ">" & note.Text
MsgBox "Done"
End Sub
Take note however that the script using the
GetActiveDiagram method to get the diagram that you want
to save to a graphic format. This means that you must
launch this script from a menu item in Rose. You cannot
run this script from a script window because if you try to
do so the script window will be the active window and not
a diagram window. To launch this script from a menu
selection you will need to modify the rose.mnu file
(located in Rose's home directory --- location of rose.exe)
in the following manner:
Menu Tools
{
Separator
option "Class Wizard..."
{
enable %model:writeable
RoseScript $SCRIPT_PATH\cwizard.ebx
}
option "Save ActiveDiagram..."
{
RoseScript $SCRIPT_PATH\addnote.ebs
}
}
In this case the script listed above is named
RenderRoseDiagrams.ebs and is located in the directory
pointed to by the $SCRIPT_PATH pathmap.
Patrick Kennedy
Rational Support
On Jan 17, 12:04, Williamson, Rusty wrote:
> Subject: (ROSE) Automating diagram comments?
>
> Hello,
>
> There is a small comment box (note box) we require for each diagram --
> contains the package, diagram name, author, last updated, reviewer, last
> reviewed. Is there any way to automate the creation of this comment box?
> Is there a 'base' template for each diagram that could be modified? Is
> there some way to get a script to create it when the diagram is created or
> via an icon or control keys?
>
> Thanks,
> Rusty
> ---------------------------------------------------------------
> Rusty Williamson
> Sr. Systems Architect
>
> Corporate Office
> GERS, Inc.
> 10431 Wateridge Circle * San Diego, CA 92121
> (800) 854-2263 * CA (858) 457-3888
> FAX (858) 484-9237 * Desk (858) 484-9237
> E-mail: [EMAIL PROTECTED] * Web http://www.gers.com
> "e-Business Solutions for the Consumer-Driven World"
>
>
> ************************************************************************
> * Rose Forum is a public venue for ideas and discussions.
> * For technical support, visit http://www.rational.com/support
> *
> * Admin.Subscription Requests: [EMAIL PROTECTED]
> * Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
> * Other Requests: [EMAIL PROTECTED]
> *
> * To unsubscribe from the list, please send email
> *
> * To: [EMAIL PROTECTED]
> * Subject:<BLANK>
> * Body: unsubscribe rose_forum
> *
> *************************************************************************
>
>-- End of excerpt from Williamson, Rusty
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************