Author Topic: Where EA holds the sequence number of elements under a package  (Read 5321 times)

tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
Where EA holds the sequence number of elements under a package
« on: January 16, 2017, 04:46:57 am »
Hi,

I am inserting new elements underneath a package.
Each time the new element is entered in the first position.
Then I can move them in EA up or down to change their order.

1. Does anybody knows where EA holds the sequence number (in DB?) of the position for each moved element?
2. Is there a specific API that I can use to change the sequence from AddIn?

Thanks,
Tzafrir

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #1 on: January 16, 2017, 05:20:05 am »
Basically it's Element.TreePos. But EA has a couple of Sparxish rules how things appear in the project browser.

q.

tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #2 on: January 17, 2017, 01:40:36 am »
Thanks,
I am seeing that EA is sorting the elements by name when inserting to the tree.
Entering TreePos does not seems to give the order in the tree.

Isnt there a way, for example, to put an element, no matter what his name is as the last element in the browser tree.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #3 on: January 17, 2017, 05:18:51 am »
As said: it's fancy. There's also an option "Sort features alphabetically" which plays a role.

q.

tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #4 on: January 17, 2017, 05:46:58 am »
But how does TreePos affects the order?
If assigned it does not seems to do anything...


tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #5 on: January 17, 2017, 06:32:37 pm »
Solved the issue.
Thanks

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Where EA holds the sequence number of elements under a package
« Reply #6 on: January 18, 2017, 08:48:31 pm »
Hello,

TreePos is a little weird. It holds the position in the tree as displayed in the project browser, but only if that order has been changed. If contents have been added to the package without ever having been resorted, TreePos is 0 for all elements because EA sorts them in its default order and doesn't look at TreePos.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.