Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: harbourfish on July 21, 2010, 01:47:08 pm

Title: How to get multiple packages?
Post by: harbourfish on July 21, 2010, 01:47:08 pm
Now, I select multiple packages in the EA. In my add-in code, I can only find m_Repository.GetTreeSelectedPage() method, which only returns one selected package. How to get multiple packages which I select in the EA?Any one could help me?
Title: Re: How to get multiple packages?
Post by: Paolo F Cantoni on July 21, 2010, 03:13:46 pm
Hi Harbourfish,

I don't think it's possible yet...

GetTreeSelectedElements()  is supposed to return a set of elements (and I think Packages are elements in this context) but if you select more than one item in the browser, the add-in sub menu is disabled so there doesn't seem to be any way for your add-in to get the event.

Perhaps others can shed more light...

HTH,
Paolo
Title: Re: How to get multiple packages?
Post by: harbourfish on July 21, 2010, 07:29:08 pm
It works! Thank you very much!
Title: Re: How to get multiple packages?
Post by: Paolo F Cantoni on July 21, 2010, 08:00:49 pm
Quote
It works! Thank you very much!
What works?  

GetTreeSelectedElements()?  How do you trigger the Add-In?

Can you tell us more?

Paolo
Title: Re: How to get multiple packages?
Post by: Geert Bellekens on July 26, 2010, 04:19:10 pm
Paolo,

I'm just guessing here, but if you first start-up the addin, then ask the user (in a non-modal form) to select elements and press [OK] then you should be able to use this GetTreeSelectedElements() no?

Geert