Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: tzafrir on January 16, 2017, 04:46:57 am

Title: Where EA holds the sequence number of elements under a package
Post by: tzafrir 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
Title: Re: Where EA holds the sequence number of elements under a package
Post by: qwerty 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.
Title: Re: Where EA holds the sequence number of elements under a package
Post by: tzafrir 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.
Title: Re: Where EA holds the sequence number of elements under a package
Post by: qwerty 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.
Title: Re: Where EA holds the sequence number of elements under a package
Post by: tzafrir on January 17, 2017, 05:46:58 am
But how does TreePos affects the order?
If assigned it does not seems to do anything...

Title: Re: Where EA holds the sequence number of elements under a package
Post by: tzafrir on January 17, 2017, 06:32:37 pm
Solved the issue.
Thanks
Title: Re: Where EA holds the sequence number of elements under a package
Post by: Uffe 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