Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Getting diagrams out as pictures?
Topic Summary:
Created On: 27-Oct-2005 19:32
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Oct-2005 19:32
User is offline View Users Profile Print this message


Richard Thumann

Posts: 5
Joined: 28-Mar-2005

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.
Report this to a Moderator Report this to a Moderator
 27-Oct-2005 19:40
User is offline View Users Profile Print this message


Richard Thumann

Posts: 5
Joined: 28-Mar-2005

Sorry, disregard the above. I figured it out...
Report this to a Moderator Report this to a Moderator
 4-Nov-2005 15:47
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.