Thanks! That actually works!
The reason why I am using the DocumentGenerator class is that I want the user to be able to right click on a diagram in Project browser, and select to generate a report on that diagram. But, not the whole diagram, only some classes in that diagram based on its color in that diagram.
Any suggestions how to accomplish this without using the DocumentGenerator class, since it seems a little bit buggy (still can't figure out how to set the page format and scale the image to fit that page)?
/Kristofer
That is exactly what I do for this client. (except for the color bit).
I have one document that is started from a diagram script.
It will report all use cases that are within the boundary.
But not only the use cases appear on the document, also things like the related requirements, the application function related to those requirements, the Business processes related to those requirements etc..
My script creates the virtual document and all the model documents. Often I use an SQL search called "searchElementByGUID" to define the contents of that document section.
The elements guid is than added as parameter.
All of this is created in a script. A typical document can easily contain 50 different Model documents, each for a different element, or some even for the same element but with a different template.
Creating a document this way is a two-step process.
1) run the script to create the virtual document
2) Generate the document manually (F8).
The advantages is that there is also room between step 1) and step 2) to review the contents of the document, and change or reorder it where required.
Geert