Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Van Lepthien on October 31, 2009, 04:26:48 am
-
I am using Java to process a project, and I would like to retrieve packages in the order in which they occur in the Project Browser. However, when I use Package.GetPackages, the order is something other than that in the package Browser (whether I use
for(Package subpkg: pkg.GetPackages()){... }
or
Collection p = pkg.GetPackages();
for(short i=0;i<p.GetCount();i++){
Package subkg = p.GetAt(i);
...}
The RTF reports write out packages in the Project Browser order, so I assume there is some way to do it.
Van
-
It appears that the package was created with a TPos of NULL, which was messing with the ordering.
It appears that as all the other packages within the parent package had TPos values of zero, the Project Browser sorted the packages in alphabetical order, with the new package (because of its name) appearing at the bottom.
Once I moved the new package, (up, and then back to where I wanted it), and the TPos value is set, the results were as I originally expected.
Environment:
Enterprise Architect 7.5.849
Version Control (Subversion)
Database: MySQL