Author Topic: Need help to get the position of elements and relations  (Read 12769 times)

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Need help to get the position of elements and relations
« on: January 04, 2018, 03:55:09 pm »
I am creating the EA plugins,

when i extract the position information for the Relations elements (aggregation, association) i get the position as 0,0,0,0

can any one suggest.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #1 on: January 04, 2018, 04:09:19 pm »
Look in the DiagramLinks collection for the Diagram.
The Sparx Team
[email protected]

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #2 on: January 05, 2018, 02:07:23 pm »
Hi Thanks for your help,

I tried using DiagramLinks, still get the same values,

DiagramID : 36
ConnectorID : 111
Style : Mode=3;EOID=89875876;SOID=B6B7D576;Color=-1;LWidth=0;
Geometry : SX=0;SY=0;EX=0;EY=0;EDGE=2;$LLB=;LLT=;LMT=;LMB=;LRT=;LRB=;IRHS=;ILHS=;
InstanceID : 101
IsHidden : False
ObjectType : otDiagramLink
Path :

Please suggest

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #3 on: January 05, 2018, 02:27:31 pm »
SX=0;SY=0;EX=0;EY=0; means the start and end points are offset zero logical units (pixels at 100%) from the center of the source and end objects.

Here's an example from a connector that I joined to the extremities of some relatively large elements.
24,75,SX=71;SY=214;EX=-273;EY=25;EDGE=2;$LLB=;LLT=;LMT=;LMB=;LRT=;LRB=;IRHS=;ILHS=;,Mode=3;EOID=13A6BC3D;SOID=3478A400;Color=-1;LWidth=0;,False, ,56,


If you want the absolute positions you need to get the center points from the objects at either end and calculate them.

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #4 on: January 19, 2018, 12:44:06 pm »
Hi,
Thanks for suggestion,

can you please help, how to find/ calculate the absolute center points of the object.


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #5 on: January 19, 2018, 01:23:07 pm »
(left + right)/2  ,  (top + bottom)/2
The Sparx Team
[email protected]

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #6 on: January 19, 2018, 03:53:56 pm »
Thanks for your reply,

I am saving the diagram as image using below method,
Diagram.SaveDiagramImageToFile(filepath);

Diagram in EA details:
Scale="100"
Cx="850" Cy="1098"

Image Details : Dimensions : 616 x 517

image dimensions and EA diagram dimensions not match.

How to save image with the same dimension as in EA??

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Need help to get the position of elements and relations
« Reply #7 on: January 19, 2018, 06:08:41 pm »
I'm not sure the saved dimensions have any relation the internal location units.

Geert

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #8 on: January 19, 2018, 08:43:34 pm »
I trying to identify the EA elements in the exported diagram.

but due to this i am not able to identify the position of the elements.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Need help to get the position of elements and relations
« Reply #9 on: January 19, 2018, 09:06:34 pm »
Check the xmi export, or the feature to export the diagram image map from the cache.

Geert