Book a Demo

Author Topic: Adding attributes noi in alphabetical order  (Read 5180 times)

Yves C

  • EA User
  • **
  • Posts: 33
  • Karma: +1/-1
  • I love YaBB 1G - SP1!
    • View Profile
Adding attributes noi in alphabetical order
« on: October 26, 2010, 02:48:40 am »
Hello,

I'm creating class attributes using a C# addin.  I want them ordered by creation date but they are always ordered by alphabetical order. It seems that addNew creates only elements ordered that way.
The code is like the following (extract) :

for (...){
  ...              
  att= (EA.Attribute)myClass.Attributes.AddNew(attName, attType);
  att.Update();
  myClass.Attributes.Refresh();
  ...
}

Is there any option or parameter to change that  behavior ? By the way it's not the "Sort Features Alphabetically" option.
Does it depend on the database ?
Any idea ?
Yves

alesliehughes

  • EA Administrator
  • EA User
  • *****
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Adding attributes noi in alphabetical order
« Reply #1 on: October 26, 2010, 01:12:59 pm »
There is no way to force the order of the Attributes via the automation interface.



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 attributes noi in alphabetical order
« Reply #2 on: October 26, 2010, 04:20:11 pm »
Doesn't the Attribute.Pos control the order of an Attribute?

Geert

Yves C

  • EA User
  • **
  • Posts: 33
  • Karma: +1/-1
  • I love YaBB 1G - SP1!
    • View Profile
Re: Adding attributes noi in alphabetical order
« Reply #3 on: October 26, 2010, 08:40:15 pm »
Yes, that's the right way to sort the attributes.

Thanks
Yves