Book a Demo

Author Topic: Detecting rotation of ProvidedInterface  (Read 5236 times)

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Detecting rotation of ProvidedInterface
« on: April 01, 2014, 09:02:55 am »
When ProvidedInterface or RequiredInterface objects are added to a model (through the Component 'Expose Interface' object). The objects take on rotation when you move them around the parent object.  

Is this rotation value stored anywhere?  I cannot seem to find it in the ObjectStyles value (DiagramObject.Style property), nor any other property.  

Thanks!
-Mike

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Detecting rotation of ProvidedInterface
« Reply #1 on: April 01, 2014, 07:58:25 pm »
Those elements have coordinates like all elements on a diagram. It's just that EA limits them to be located around the attached element. In V10 the automation was broken compared to 9.3 so it was not possible to place objects meaningful. (That reminds me to test it with V11 once again)

In Shape Script you can query a property to which side an element is attached to its embedding element.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Detecting rotation of ProvidedInterface
« Reply #2 on: April 01, 2014, 09:37:55 pm »
I'm positively surprised that the issue with creating a docked element via API has been fixed with V11.

q.

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Detecting rotation of ProvidedInterface
« Reply #3 on: April 02, 2014, 02:52:08 am »
I'm working with the Automation object model, re-creating diagrams in Visio through automation.  I did see the Shape Script query method HasProperty, but don't see this exposed in the automation model.  Is there a way to query rotationdirection (which is a connector property?) for the ProvidedInterface/RequiredInterface objects from the automation model?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Detecting rotation of ProvidedInterface
« Reply #4 on: April 02, 2014, 04:55:24 am »
No. As said you need to query the coordinates for embedded and parent. Then check to which side the coordinates overlap. It's simple arithmetic.

q.

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Detecting rotation of ProvidedInterface
« Reply #5 on: April 02, 2014, 05:34:40 am »
Thanks, it wasn't clear that you were recommending to do the coordinate math, but that is the direction I was considering without the ability to get the rotation from Sparx programmatically.

Thx.