Book a Demo

Author Topic: Adding port to a diagram programmatically  (Read 3874 times)

ESSW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Adding port to a diagram programmatically
« on: February 26, 2015, 05:50:04 am »
In the model, I have a component with a port.
In the diagram, I only have the component.
In an add-in, when trying to add the port to the diagram, it is being added in an arbitrary location (somewhere top left) instead of locking on the component.
Is there a way to fix this?

Thanks

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Adding port to a diagram programmatically
« Reply #1 on: February 26, 2015, 10:31:18 am »
EA stores the position of embedded elements in absolute values, not relative to the parent. So you will need to read the position of the parent element and calculate where the port needs to go from that.
The Sparx Team
[email protected]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding port to a diagram programmatically
« Reply #2 on: February 27, 2015, 04:05:48 am »
This was broken in V10 and V11 and had been fixed with V!2.

q.

ESSW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Adding port to a diagram programmatically
« Reply #3 on: March 01, 2015, 08:39:52 pm »
Thank you