Book a Demo

Author Topic: Diagram Image  (Read 4460 times)

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Diagram Image
« on: August 24, 2011, 10:41:26 am »
Greetings!

I had a problem with diagram image :-)
How can i receive the diagram image in .gif or .jpg from my eap project?
How this method works at report generation?
May be there is any script for this purpose.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image
« Reply #1 on: August 24, 2011, 04:12:04 pm »
Have you tried Ctrl-T?

Geert

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Diagram Image
« Reply #2 on: August 24, 2011, 07:26:19 pm »
Thank you Geert!
But can i make it with a script if I need to receive all diagrams of the eap project?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image
« Reply #3 on: August 24, 2011, 08:34:22 pm »
In that case you need to use Project Interface.PutDiagramImageOnClipboard (string DiagramGUID, long Type)
 or PutDiagramImageToFile (string Diagram GUID, string FileName, long Type)

Geert

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Diagram Image
« Reply #4 on: August 24, 2011, 09:31:30 pm »
It works!
Can i save the diagram image in other folder? :-)
string FileName doesn't work for this purpose.



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image
« Reply #5 on: August 24, 2011, 10:16:31 pm »
I would have thought you could pass something like "c:\\temp\\myImage.jpg" to the method.
Doesn't that work?

Geert

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Diagram Image
« Reply #6 on: August 24, 2011, 11:56:18 pm »
Thank you. It works.

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Diagram Image
« Reply #7 on: August 25, 2011, 06:34:29 am »
Sorry, but I had a question :-)
It is necessary for me to recieve GUIDs of all custom diagrams of the project. I have decided to realize it through SQL query:

query = "SELECT ea_guid FROM t_diagram WHERE Diagram_Type = 'Custom'";

But I receive:

<?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
<Dataset_0><Data><Row><ea_guid>{9065F91F-A4F8-4329-9871-5761CAF1EF57}</ea_guid>......

How to solve this problem?
It can be possible to solve my problem differently somehow?

Tnx.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image
« Reply #8 on: August 25, 2011, 06:50:57 am »
I don't see the problem, the result looks exactly as expected :-/

Geert

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Diagram Image
« Reply #9 on: August 25, 2011, 07:11:54 am »
But i need only {9065F91F-A4F8-4329-9871-5761CAF1EF57} without <EADATA... to fill GUID in Project.PutDiagramImageToFile(Diagram_GUID, File_name, 1); :)

str.slice function is the decision for me now but it's inconvenient.

Decision was found:
"Microsoft.XMLDOM" and getElementsByTagName()
It works :)




« Last Edit: August 28, 2011, 05:39:48 am by 666999 »