Author Topic: Java API : Diagram Export Problem  (Read 3383 times)

Vv

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Java API : Diagram Export Problem
« on: January 16, 2009, 02:02:22 am »
I try to export a Diagram from EA to a bmp file.
I do like this:

Code: [Select]
Repository r = new org.sparx.Repository();
r.OpenFile("D:/Projets/toto/ea/ProjetToto/toto.eap");
Project project = r.GetProjectInterface();
String str = "{17F0F0FF-4F26-4b6d-8FC7-7456AACD7BF1}"

String image = project.ExportPackageXMI(str, EnumXMIType.xmiEADefault, 1, 1, 1, 1,"myPicture");
System.out.println("Ecriture de l'image :"+image);

I can't find any picture and variable 'image' is empty.

Could you help me?
« Last Edit: January 16, 2009, 02:02:45 am by Steven35 »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Java API : Diagram Export Problem
« Reply #1 on: January 16, 2009, 09:03:59 am »
Try replacing "myPicture" with a full path.  But remember that this function is saving an XML file, so something along the lines of "C:\Images\Package.xml".  You probably have a file "myPicture" in the directory EA was started from with bitmaps sitting next to it.

The return value gives an error string, so at least I can say that the package does exist.

Vv

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Java API : Diagram Export Problem
« Reply #2 on: January 16, 2009, 09:56:49 pm »
is it possible to export just one diagram in a bmp, jpg file?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Java API : Diagram Export Problem
« Reply #3 on: January 19, 2009, 08:01:50 am »

Vv

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Java API : Diagram Export Problem
« Reply #4 on: January 19, 2009, 08:13:36 pm »
OK it's working. Thanks for all