Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: aviv on September 11, 2014, 08:36:05 pm

Title: Get all nested packages (recursive) of package
Post by: aviv on September 11, 2014, 08:36:05 pm
I would like to get all packages (also the nested ones) if a branch.  
(Isn't it a good idea for a new ability of API? I'm surprised it is not exist as a property of EA.Package [smiley=undecided.gif])

The way is to loop on the collection
Code: [Select]
package.Packages.Does EA.collection implements <IEnumerable>?
Title: Re: Get all nested packages (recursive) of package
Post by: qwerty on September 11, 2014, 09:19:12 pm
I guess the reason is simply that returning the nested packages would also bear the need for the structure of those. So you'd parse either way. Write a wrapper that returns a collection of nested packages in the order you want it.

q.
Title: Re: Get all nested packages (recursive) of package
Post by: aviv on September 11, 2014, 10:20:18 pm
Thanks. I'll try and update.