How to export all Object Model Diagram from Rational Rhapsody using Java API

Technote (FAQ)


How do you export all Object Model Diagram from IBM Rational Rhapsody using Java API?


You would like to use Java Application Programming Interfaces [API] code to automate the manual task to be performed with in Rational Rhapsody or to achieve something that is not possible through the Rhapsody GUI.


In order to export all Object Model Diagram from Rational Rhapsody using JAVA API iyou can use the below code as a reference. The code can be enhanced to include other specific diagram types


All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

IRPApplication myApp = RhapsodyAppServer.getActiveRhapsodyApplication();
IRPProject myPrj = myApp.activeProject();

Iterator myIter1 = myPrj.getObjectModelDiagrams().toList().iterator();
while(myIter1.hasNext()) {
IRPDiagram myDia = (IRPDiagram);
myDia.getPictureAs("C:\\Work\\Images\\"+myDia.getName()+".jpg", "JPEG",
0, null);

Document information

More support for:

Rational Rhapsody
General Information

Software version:

7.5.3,,, 7.6,, 7.6.1,,,, 8.0, 8.0.1, 8.0.2

Operating system(s):


Reference #:


Modified date:


Translate my page

Content navigation