Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: nikhilyewalekar on January 04, 2018, 03:55:09 pm

Title: Need help to get the position of elements and relations
Post by: nikhilyewalekar 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.
Title: Re: Need help to get the position of elements and relations
Post by: KP on January 04, 2018, 04:09:19 pm
Look in the DiagramLinks collection for the Diagram.
Title: Re: Need help to get the position of elements and relations
Post by: nikhilyewalekar 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
Title: Re: Need help to get the position of elements and relations
Post by: Eve 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.
Title: Re: Need help to get the position of elements and relations
Post by: nikhilyewalekar 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.

Title: Re: Need help to get the position of elements and relations
Post by: KP on January 19, 2018, 01:23:07 pm
(left + right)/2  ,  (top + bottom)/2
Title: Re: Need help to get the position of elements and relations
Post by: nikhilyewalekar 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??
Title: Re: Need help to get the position of elements and relations
Post by: Geert Bellekens on January 19, 2018, 06:08:41 pm
I'm not sure the saved dimensions have any relation the internal location units.

Geert
Title: Re: Need help to get the position of elements and relations
Post by: nikhilyewalekar 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.
Title: Re: Need help to get the position of elements and relations
Post by: Geert Bellekens 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