Author Topic: Save diagrams as images with program  (Read 5615 times)

Sreedhar

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Save diagrams as images with program
« on: May 09, 2015, 10:24:16 pm »
Usually in EA, We do following

- Open the diagram
- Save image as Diagram

1. How can we do this with any program (C#,Java) in EA ?

We use the MySQL repository.

1. Is there any way, we can create a diagram from the diagram/objects stored in tables using any program (C#,Java)?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Save diagrams as images with program
« Reply #1 on: May 11, 2015, 01:28:29 am »
1.(a) Yes. You can use ProjectInterface.PutDiagramImageToFile

1.(b) Yes. Use the API to do that.

q.

Sreedhar

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Save diagrams as images with program
« Reply #2 on: May 11, 2015, 01:33:34 am »
thank you for the suggestion.

I am looking for offline solution. Like i am going to write java program and get the information from MySQL. Create a diagram.

Did you come across any examples with this requirement ?

Please share the example.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Save diagrams as images with program
« Reply #3 on: May 11, 2015, 03:44:32 am »
I have no of-the-shelf example for either. But both are not very difficult at all. Of course I'd recommend to have a look into my Scripting book (link below). If you run into any difficulties you can still ask for help for details.

q.

Knut Jetlund

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I am the lizard king. I can do anything
    • View Profile
Re: Save diagrams as images with program
« Reply #4 on: May 11, 2015, 04:39:39 pm »
I have a VBScript for exporting diagrams to image files, here: https://github.com/jetgeo/EA_Dakat2UML/blob/master/Scripts/Export%20diagrams%20as%20images.vbs

It exports three specific diagrams from each package, and with some modifications it may be helpful to you.
Knut Jetlund
Norwegian Public Roads Administration

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: Save diagrams as images with program
« Reply #5 on: May 11, 2015, 05:27:52 pm »
I'm guessing Sreedhar wants to programatically:
  • Create a diagram
  • Pick objects from the table and add to the above diagram
  • Create an image of the diagram

Sreedhar

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Save diagrams as images with program
« Reply #6 on: May 11, 2015, 07:09:37 pm »
Yes, VKN - you are right.

What ever the solutions so far came across to me are looking for the .eap project. Then, using API the existing diagrams will be exported.

We were thinking to leverage the mysql database storage by having offline solution to pick the diagrams existing in models. that way, we can provide read access to the users only interested in checking final output. than having installation of EA in their system and have a look for models.

Let me give my idea : We are storing the image content as blobs in mysql database columns. Can we extract the blob content and make a image ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Save diagrams as images with program
« Reply #7 on: May 11, 2015, 07:14:06 pm »
Yes and no. The diagrams are rendered on the fly by EA. You *can* store the rendering as blob in the db. But for what use? Better use a HTML export if offline navigability is what you want.

Further: if you want to store blob data in the DB you need to create your own table. That *is* possible but of course not recommended. You may come in conflict with EA (although unlikely) but XMI export/import will simply ignore your tables.

q.

Sreedhar

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Save diagrams as images with program
« Reply #8 on: May 11, 2015, 08:12:17 pm »
thank you for the suggestion.

If we want to update the HTML screens with fresh data, We just need to trigger the eap again and again.
« Last Edit: May 11, 2015, 10:44:36 pm by Sreedhar »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Save diagrams as images with program
« Reply #9 on: May 12, 2015, 01:53:26 am »
There are a couple of threads here dealing with an automated export of HTML. The difficulty here is that EA can not easily be run as service.

q.