Book a Demo

Author Topic: projectInterface.GetDiagramImageAndMap(String,String);  (Read 4993 times)

michal.p

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
projectInterface.GetDiagramImageAndMap(String,String);
« on: July 28, 2017, 10:52:14 pm »
Hello Everyone,

I am trying to draw EA diagrams with external application (webapp).
For this I need coordnates for each object in diagram.
Right now I am using diagramObject.Get... but I cant get stable data from it.
Here are three diagrams generated with the same code:
https://ibb.co/dEk69k
https://ibb.co/eNQTN5
https://ibb.co/gwZcFQ
The red dot is top left corner reported by diagramObject.GetTop() and diagramObject.GetLeft()  (Only elements with composite child have dot)
Dots are drawn as absolute from left top corner of the wep page. I am using direct numbers from GetLeft and absolute numbers from GetTop(as the data from this method is negative)

Diagram itself is generated with projectInterface.PutDiagramImageToFile(diagramGuid, filePath, saveMode);

Anyone can help me to get this right or simply the methods are not reliable for this task ?


I also know of new Method:
projectInterface.GetDiagramImageAndMap(String,String);

I did not found any specification in the reference.
How exacly this method works? What are the input parameters, why it returns boolean ?

Thanks
Best Regards
Michał
« Last Edit: July 28, 2017, 11:38:59 pm by michal.p »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: projectInterface.GetDiagramImageAndMap(String,String);
« Reply #1 on: July 31, 2017, 08:52:48 am »
PutDiagramImageToFile will clip to the area needed by the objects being drawn. Then the diagram frame is added. Both result in the coordinate space being changed.

You could write code to calculate the offset from the returned values by finding the topmost and leftmost element, then adding padding.

michal.p

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: projectInterface.GetDiagramImageAndMap(String,String);
« Reply #2 on: August 01, 2017, 06:46:07 pm »
Thank You Simon for Your time,

How can I access data about padding ? Any method in the api or is it a constant number of pixels ?

Best Regards
Michał

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: projectInterface.GetDiagramImageAndMap(String,String);
« Reply #3 on: August 02, 2017, 08:46:40 am »
There's no API to query the padding. Start with some known numbers and see how they come out when generated as images.