Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: OilyRag on September 20, 2007, 08:44:25 pm

Title: TreePos
Post by: OilyRag on September 20, 2007, 08:44:25 pm
I've been working with the automation interface, creating a package hierarchy programatically in a recursive descent like way, specifying exactly the order in which I want my packages to be seen in (as I imagine seeing them in the project browser).

However, they never appear in the desired order in the project browser once my automation addin completes. Why?

I guess the next question would be, if I ran a recursive descent parsing algo on the model in my automation code, would I encounter the packages in the order I created them? I havent tried that yet but will later today.

Has anyone else got some insight into what EA is doing here?

Does setting TreePos on a newly created object do anything?

How can I stop EA apparently sorting packages alphabetically or otherwise?
:-/
Title: Re: TreePos
Post by: thomaskilian on September 21, 2007, 01:27:44 am
Alphabetical ordering is an option (somewhere in the options djungle)
Title: Re: TreePos
Post by: «Midnight» on September 21, 2007, 03:27:46 am
Check out the following:

The Allow Free Sorting box on the main Tools | Options dialog. This affects how things are displayed in the Project Browser tree.

On the Tools | Options | Objects dialog look at the check boxes near the bottom of both columns. These have a lot to do with how features are sorted.

David
Title: Re: TreePos
Post by: OilyRag on September 23, 2007, 03:40:33 pm
I already have "Allow Free Sorting" enabled, and I have already turned off the Tools-Objects-Sort Features Alphabetically option. It has made no difference.

I am using EA version 7.0.815 by the way.
Title: Re: TreePos
Post by: OilyRag on September 26, 2007, 07:50:04 pm
Sparxsupport emailed me a solution

Calling RefreshModelView() seems to do the trick.

Title: Re: TreePos
Post by: «Midnight» on September 27, 2007, 03:21:01 am
There was quite a discussion on related issues within the past few weeks. You might want to search on RefreshModelView to see if there was anything else you might want to know.