Book a Demo

Author Topic: Adding new element - what is its position  (Read 4759 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Adding new element - what is its position
« on: March 11, 2010, 10:56:46 pm »
Hi Again
So my addin creates a new diagram and places a newly created note element.
Trouble is it is not in the correct place, so I thought I would move it down the diagram by adjusting the 'top' property for the object(I realize that this gets smaller as you move down the diagram). However, this has no effect.
I think the reason is that if I retrieve the left,top,right and bottom values of the object immediately after adding to the diagram these values are larage (say 4259909), this means that a proper rectangle is not formed so no change takes place.
Anyone know how to correct this?

Graham
Using V12

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding new element - what is its position
« Reply #1 on: March 11, 2010, 11:16:02 pm »
Have you tried to update() before retrieving the position values?

Geert

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Adding new element - what is its position
« Reply #2 on: March 11, 2010, 11:20:57 pm »
of course  :)
Using V12

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding new element - what is its position
« Reply #3 on: March 11, 2010, 11:24:27 pm »
Hmm, looks like the position values don't get updated in the note object then.
What happens when you retrieve the note again from the Diagram?

Geert

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Adding new element - what is its position
« Reply #4 on: March 12, 2010, 01:03:18 am »
Hi Geert
If I set the values as part of the AddNew method everything is fine.
If I dont set these the values are random but the diagram object displays itself in the top left corner which means you cant just move the object down the diagram by adjusting the top value.
Using V12

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding new element - what is its position
« Reply #5 on: March 12, 2010, 01:04:49 am »
Ah, I see. Good to know.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Adding new element - what is its position
« Reply #6 on: March 12, 2010, 09:59:38 am »
Quote
Ah, I see. Good to know.

Geert
Sorry, I didn't get to this in time...  (I was fast asleep)

I can confirm the behaviour Graham sees...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!