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: Exporting diagrams to postscript
Topic Summary:
Created On: 1-Feb-2007 06:05
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.
 1-Feb-2007 06:05
User is offline View Users Profile Print this message


Leonid Ryzhyk

Posts: 10
Joined: 27-Sep-2006

I am trying to produce a postscript version of a Rhapsody diagram (in Linux) in order to embed it in a latex document. Using the "print to file" option I can produce a 1-page ps file with the diagram. If the diagram is small, there is a lot of white space around it. Is there a way to get Rhapsody generate a ps image that would fit exactly the size of the diagram?

Thanks,
Leonid
Report this to a Moderator Report this to a Moderator
 1-Feb-2007 16:24
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Leonid

I can't give you a complete answer, but perhaps an idea... The following is the code for a (Windows) VBA macro to save a diagram to a file in EMF format:

[CODE]'*****************************************************************************
'** exportDiagramAsEmf
'**
'** Export the selected diagram to a 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, "exportDiagramAsEmf"
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]

I realise you don't have VBA on Linux, but I think I recall there is some cross-platform scripting available in Rhapsody 7? Anyway, if you can access the Rhapsody object model at all from Linux, you can probably replicate this functionality of this script.

I don't know if the RPDiagram.getPicture function returns a Windows Extended Metafile on Linux, or some other more appropriate format. Whatever it gives you, I imagine you'll be able to convert it to Postscript... (Google lists plenty of options for EMF-to-PS.)

I hope that helps,
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.