Book a Demo

Author Topic: Save the Image for each EA-Element from EA-Model  (Read 4004 times)

mabed

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Save the Image for each EA-Element from EA-Model
« on: January 11, 2017, 06:03:46 am »
i want to develope a small program for importing all EA-Elements from EA model in my eclipse-plugin.
I developed it successfully over EA.jar but i have a problem. This problem is that i want to save the image from each Class, State Machine or Activity Diagram. I do that so, but i have for all elements the same image, although i send per (child.getElementGUID()) each time another element id!!

Repository rep = new Repository();
String path = ".....//...jpg";
........
........
........
rep.GetProjectInterface().PutDiagramImageToFile(child.getElementGUID(), c, 1);


please advise

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Save the Image for each EA-Element from EA-Model
« Reply #1 on: January 11, 2017, 08:12:04 am »
The clue appears to be child.getElementGUID().

It should be getDiagramGUID() for a diagram, which implies you aren't iterating over diagrams but elements.

mabed

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Save the Image for each EA-Element from EA-Model
« Reply #2 on: January 12, 2017, 11:34:47 pm »
yes i know that i send the Element GUID.

my problem now is how to fetch a Block-Diagram or Class-Diagram. The block over EA.jar is an Element!!
how can ic make screenshot from it?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Save the Image for each EA-Element from EA-Model
« Reply #3 on: January 13, 2017, 01:57:21 am »
I don't understand you. A class, (or any other element) doesn't have an image. Only diagrams have images.

If you have a state machine that owns a diagram you could get that diagram.
Diagrams owned by an element are found in EA.Element.Diagrams. Diagrams owned by a package are found in EA.Package.Diagrams.

Geert