Author Topic: C# AddIn: Set element position on a diagram  (Read 3867 times)

AndreasBaur

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
C# AddIn: Set element position on a diagram
« on: May 01, 2012, 12:38:50 am »
Hi everyone,

in my addin, i'm creating multiple elements on a diagram. My problem is, that after my addin run through, all elements on that diagram are on top of each other and the size is horrible. They all have a small width and big height.
Is there a way to set the size of an element proper?

I tried setting the size using repository.Execute(SQLString) but with no success. When i look into the table t_diagramobjects using MS Access the RectTop etc. is set exactly to what i want it but in the EA it's the same as before.

Thank in advance for your help.
Andy

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: C# AddIn: Set element position on a diagram
« Reply #1 on: May 01, 2012, 02:57:04 am »
you can set the size of you diagramObjects easily via the 4 Attributes
Bottom, Top, Left, Right.

http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/diagramobjects.html

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13402
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: C# AddIn: Set element position on a diagram
« Reply #2 on: May 02, 2012, 03:35:00 pm »
You just have to remember that it uses a bit of a weird system of axes (vertical negative, horizontal positive IIRC)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: C# AddIn: Set element position on a diagram
« Reply #3 on: May 02, 2012, 07:46:43 pm »
Actually here EA is not weird. Top left of the diagram is defined is the 0|0 coordinate. And like in Cartesian coordinates up/right is positive and down/left is negative. Since you see only the down/right part it's this negative/positive numbering.

q.