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

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 4
  • 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: 2441
  • Karma: +29/-2
    • 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
support@sparxsystems.com

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 4
  • 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

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6215
  • Karma: +49/-5
    • 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.
Simon

support@sparxsystems.com

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #4 on: Today at 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: 2441
  • Karma: +29/-2
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #5 on: Today at 01:23:07 pm »
(left + right)/2  ,  (top + bottom)/2
The Sparx Team
support@sparxsystems.com

nikhilyewalekar

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Need help to get the position of elements and relations
« Reply #6 on: Today at 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??