Book a Demo

Author Topic: GetTreeSelectedPackages()  (Read 9915 times)

zapurvis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
GetTreeSelectedPackages()
« on: March 29, 2016, 04:07:18 am »
There is a GetTreeSelectedElements(). 
How about throwing in a GetTreeSelectedPackages() from the Repository class.

Is there any word on whether this is going to occur?

very similar to:
http://sparxsystems.com/forums/smf/index.php/topic,29860.msg219048.html#msg219048

Zak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GetTreeSelectedPackages()
« Reply #1 on: March 29, 2016, 04:48:19 am »
Zak,

GetTreeselectedElements already returns the selected Packages.
Packages are a bit schizophrenic.  They are part Package and part Element but share the same GUID.
In order to get the Element part of a Package you use Package.Element
In order to get the Package part of the element (of type Package) you use Repository.GetPackageByGUID(Element.ElementGUID)

Geert

zapurvis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: GetTreeSelectedPackages()
« Reply #2 on: March 29, 2016, 06:48:43 am »
I am requesting:
Repository.GetTreeSelectedPackages()

This presently does not exist.  If I select 4 Packages, not elements, in the Project Browser, I want to retrieve a Collection containing only those packages.

Or give me some Jscript way to get the selected Packages from the Project Browser.

Zak
« Last Edit: March 29, 2016, 06:50:25 am by zapurvis »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: GetTreeSelectedPackages()
« Reply #3 on: March 29, 2016, 07:22:58 am »
From the list of elements you get from GetTreeSelectedElements just get the type to see that it's a package. Then use Repository.GetPackageByGuid(element.elementGuid). This returns the according package.

q.

zapurvis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: GetTreeSelectedPackages()
« Reply #4 on: March 29, 2016, 09:34:20 am »
I am sorry, I need to be more clear.  I am not using Repository.GetTreeSelectedElements().  This function returns NULL.  I am requesting a brand new function which will return Packages.

In the Project Browser:
Select 3 packages at the same level. (ONLY PACKAGES)

I want these packages to be returned in the API. 

Repository.GetTreeSelectedElements()  == Null.

Or, How can I figure out which Packages are selected.  There are zero elements selected.

I am using EA 10.

Thanks,
Zak


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: GetTreeSelectedPackages()
« Reply #5 on: March 29, 2016, 10:50:42 am »
GetTreeSelectedElements() returns a collection with elements/packages/whatever. If your version doesn't you should probably upgrade to the recent V12.

q.