PLEASE,

DO NOT SEND MORE MAILS FROM THIS RECIPIENT. IT�S MY WORK MAIL AND I DON�T WANT TO RECEIVE THEM ANYMORE!!!


Annamalai Viswanathan <[EMAIL PROTECTED]>
Enviado Por: [EMAIL PROTECTED]

10/01/01 09:47
Responder a Annamalai Viswanathan

       
        Para:        Peter Lindgren <[EMAIL PROTECTED]>
        cc:        [EMAIL PROTECTED]
        Assunto:        Re: (ROSE) Diagram.Render on 2000e, Solaris



Peter,

Listed below is a script that uses the Render method that works.  Check this out and see how
your script may be different:

'<<START SCRIPT>>
'Annamalai "Vishu" Viswanathan
'12/22/1999

Sub Main

Begin Dialog SaveDialog ,,180,51,"Save Diagram"
         OKButton 132,8,40,14
         OptionGroup .OptionGroup1
         OptionButton 12,12,84,8,"Windows Metafile (.wmf)",.wmf
         OptionButton 12,28,112,8,"Windows Enhanced Metafile (.emf)",.emf
End Dialog

Dim MyDialog As SaveDialog
Dim theModel As Model
Dim theDiagram As Diagram

Const w$ = "Windows Metafiles:*.WMF"
Const e$ = "Enhanced Windows Metafiles:*.EMF"

Set theModel = RoseApp.CurrentModel
Set theDiagram = theModel.GetActiveDiagram

If theDiagram Is Nothing Then
     MsgBox "There is currently no active diagram"
Else
      result = Dialog(MyDialog)
      ctrl = MyDialog.OptionGroup1
      If ctrl = 0 Then
           f$ = SaveFilename$(theDiagram.Name, w$)
           If f$ = "" Then
                MsgBox "No file name was specified"
           Else
                 theDiagram.Render f$
           End If
       Else
            f$ = SaveFilename$(theDiagram.Name, e$)
            If f$ = "" Then
                  MsgBox "No file name was specified"
            Else
                  theDiagram.RenderEnhanced f$
            End If
        End If
End If

End Sub

'<<END SCRIPT>>
'--------------------

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 in the following manner:

Menu Tools
{

Separator
option "Class Wizard..."
 {
         enable %model:writeable
         RoseScript $SCRIPT_PATH\cwizard.ebx
 }
option "Save ActiveDiagram..."
 {
         RoseScript $SCRIPT_PATH\RenderRoseDiagrams.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.

Regards

Vishu


Peter Lindgren wrote:

> Hi folks!
> I'm trying to render diagrams to a metafile using
> the Render operation on the diagram.
> I think I have a valid diagram object, since I can
> print the .Name property, which is correct.
> I get no errors, but no file either, whatsoever.
>
> This is the code line I use:
>   aDiagram.Render "kkk.wmf"
>
> Thanks for any help,
> Peter
> --
> Peter Lindgren                             Bachelor of Computer Engineering
> ERIEYE C2 Software Design                   http://www.ericsson.com/erisoft
> Get your own AWACS:  http://www.ericsson.se/microwave/2-Products/erieye.asp
> --- Opinions above, expressed or implicit, are my personal opinons only ---
> ************************************************************************
> * 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
> *
> *************************************************************************
************************************************************************
* 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
*
*************************************************************************



Reply via email to