I am attempting to generate metafile images for all the diagrams in a
model. For some reason the following script as well as some other
approaches I have tried to solve this problem, cause Rational Rose to
crash. The models I need the images to be generated for are moderately
large. I tested the following script on the sample "ordersys.mdl" file
and it crashed during execution. Most likely, I feel this is a memory
limitation, since occasionally the script will complete and it never
seems to crash in exactly the same spot. If anyone could try the
following script and provide me with some feedback, it would be much
appreciated. I have simplified my original program so that there are no
subroutines and no variables. In theory this should reduce any conflict
with stack memory limitations.
I have been informed that any memory limitations should be overcome if I
write an Add-in using VB. This is something I don't have any experience
with and any resources would be greatly appreciated. I am hoping there
will be a better solution.
Sub Main
'Output file for writing out the errors.
Open "WMFerrors.txt" For Output Access Write Lock Write As #1
'Output for images rendered.
Open "WMFrendered.txt" For Output Access Write Lock Write As #2
'Catch any errors and print them out.
On Error GoTo CatchError
'Loop through each category and render each of the class
diagrams and each of the scenario diagrams.
For i = 1 To RoseApp.CurrentModel.GetAllCategories().Count
For j = 1 To
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ClassDiagrams.Count
Write #2,
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ClassDiagrams.GetAt(j).Na
me
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ClassDiagrams.GetAt(j).Re
nder "CD.wmf"
Next j
For j = 1 To
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ScenarioDiagrams.Count
Write #2,
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ScenarioDiagrams.GetAt(j)
.Name
RoseApp.CurrentModel.GetAllCategories.GetAt(i).ScenarioDiagrams.GetAt(j)
.Render "SD.wmf"
Next j
Next i
'Loop through each subsystem and render each of the module
diagrams.
For i = 1 To RoseApp.CurrentModel.GetAllSubsystems().Count
For j = 1 To
RoseApp.CurrentModel.GetAllSubsystems.GetAt(i).ModuleDiagrams.Count
Write #2,
RoseApp.CurrentModel.GetAllSubsystems.GetAt(i).ModuleDiagrams.GetAt(j).N
ame
RoseApp.CurrentModel.GetAllSubsystems.GetAt(i).ModuleDiagrams.GetAt(j).R
ender "MD.wmf"
Next j
Next i
'Print out any errors encountered.
CatchError:
Write #1, "Error Number: " & Str(Err.Number)
Write #1, "Error Description: " & Err.Description
Write #1, ""
'Clear error status.
Err = -1
End Sub
g GE Medical Systems
__________________________
David Knight
* [EMAIL PROTECTED]
Software Engineering Intern
> % (262) 521-6586
>
************************************************************************
* 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
*
*************************************************************************