![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Getting diagrams out as pictures? Topic Summary: Created On: 27-Oct-2005 19:32 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have a need to get just the diagrams from the model saved as picture files (jpg). Has anyone done this successfully or at least have a method that reliably works?
I've tried the following. Copying from Rhapsody directly into MS Paint (seems to compress the image badly). Creating a word doc from reporter or reporter plus and then copy and paste into Paint. I've also tried replacing Paint with other paint programs such as GIMP. The best I can do in terms of getting detailed images is to paste the picture into Word directly (after specifying the page size correctly) and then copying from Word to a GIMP pallete but for some reason the GIMP paste buffer truncates the image even though the receiving blank pallete is large enough. |
|
![]() |
|
![]() |
|
Sorry, disregard the above. I figured it out...
|
|
![]() |
|
![]() |
|
Hi Richard
It's great you figured out a solution. ![]() I thought I'd post my solution anyway, in case it's useful to any other readers. This VBA code will allow you to export any diagram to an Enhanced Windows Metafile (.EMF) file: [CODE]'Save the selected diagram to as an Windows Extended Metafile Public Sub exportDiagramAsEmf() 'Get current selected element Dim sElt As RPModelElement Set sElt = getSelectedElement 'Check that we have a diagram element selected If Not TypeOf sElt Is RPDiagram Then Dim errMsg errMsg = "Please select a diagram before running this macro." & vbCrLf MsgBox errMsg, vbCritical Exit Sub End If 'Prompt the user for a filename and save the diagram as an EMF file Dim objDialog Set objDialog = CreateObject("SAFRCFileDlg.FileSave") objDialog.filename = sElt.name & ".emf" objDialog.fileType = "Extended Metafile" If objDialog.OpenFileSaveDlg Then sElt.getPicture (objDialog.filename) End If End Sub [/CODE] To use this code: [list=1] [*]Open your project in Rhapsody. [*]Choose Tools\VBA\Visual Basic Editor from the menu (if licensed!) [*]Insert a new module, then paste in the above code. [*]Close the Visual Basic Editor. [*]Select a diagram in Rhapsody. [*]Choose Tools\VBA\Macros... from the menu. [*]Select the macro from the list, and click Run. [/list] best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Getting diagrams out as pictures?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.