![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: Outputting Diagram via VBA Topic Summary: How to output a diagram automatically using VBA Created On: 11-Jul-2006 06:19 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: 'pass the diagram object to this routine (in this example called passed_diagram_object) Dim imfSA as Object | |
![]() |
|
Does anyone know how to output a diagram (say in JPG or SVG format) using VBA?
There is a method called render ( diagram.picture.render ) but I'm not sure of the properties to supply. I have checked through the VBA Extensibility document that comes with SA but that doesn't even mention the method at all. The method is as follows: Sub Render(hdc as Long, x as Long, y as Long, cx as Long, cy as Long, xSrc as OLE_XPOS_HIMETRIC, ySrc as OLE_YPOS_HIMETRIC, cxSrc as OLE_XSIZE_HIMETRIC, cySrc as OLE_YSIZE_HIMETRIC, prcWBounds as Any) I know I could output the pictures using a report, but I find the reports limited, and have written my own macro to search definitions and diagrams for text (case insensitive) and output the results. I can output the properties of the diagrams it found, but I would really like to be able to output a picture of the diagram as well. Any help would be greatly appreciated. |
|
![]() |
|
![]() |
|
'pass the diagram object to this routine (in this example called passed_diagram_object) Dim imfSA as Object Edited: 11-Jul-2006 at 06:56 by Duane Hennessy |
|
![]() |
|
![]() |
|
Do I need to add a reference to anything as I get a Sub or Function no defined on InitiateISAImf
|
|
![]() |
|
![]() |
|
Maybe a module I need to add? PS Thanks for your help Edited: 11-Jul-2006 at 07:29 by Dale Moore |
|
![]() |
|
![]() |
|
Found it : Had to change it to be:
Set imfSA = saApp.Interface("ISAImf") Woot! Thanks for your help - it works. |
|
![]() |
|
![]() |
|
If you want to output the picture to a Word document for instance, check the code in the SA word templates, e.g. SADiags9.dot in the Templates folder...
|
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.