Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: AdamK on November 21, 2012, 11:20:28 pm
-
Hello,
In my add-in, I need to copy all the attributes from class A to class B. However, the order of attributes of B displayed in the diagram is alphabetic rather than the same order of attributes of class A.
Is there a way to display the attributes of class B with the same order as attributes of class A?
Thanks!
-
Use EA.Attribute.Pos
Geert
-
Thanks Geert! You've been very helpful!!
-
Use EA.Attribute.Pos
Geert
Yes, but ensure you do your own checks because you can have situations like this in EA - logged from my programme:
[main] ERROR [+++ EA problem: attr count on MyClass = 3
, +++ attr [0] name = value, pos = 0
, +++ attr [1] name = normaIlyInService, pos = 1
, +++ attr [2] name = curveStyle, pos = 0
]
This may happen when you do drag/drop of attributes from the project browser onto the class in a diagram, to have multiple attributes with the same value in Pos.
I've filed the issue officially (registered user) very loooong time ago, but this still may happen with EA 9.3...