Book a Demo

Author Topic: Knowing Project NAME  (Read 14897 times)

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Knowing Project NAME
« on: April 24, 2015, 10:04:08 pm »
How could I know the name of the project using API or even EA.Query
to get the name of the model {root-name}
see the picture please



Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Knowing Project NAME
« Reply #1 on: April 24, 2015, 10:19:30 pm »
This should be posted int he automation forum, but Repository.Models should work.

Geert

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Knowing Project NAME
« Reply #2 on: April 24, 2015, 10:29:16 pm »
Sorry for that,,
but I did not get any root-name


Regards,
« Last Edit: April 25, 2015, 01:07:12 am by dangel »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Knowing Project NAME
« Reply #3 on: April 24, 2015, 11:53:10 pm »
I can't see you image (blocked by corporate network) but for me that works, and the documentation says:

Quote
Models are of type Package and belong to a collection of Packages. This is the top level entry point to an Enterprise Architect project file. Each model is a root node in the Project Browser and can contain items such as Views and Packages.

A model is a special form of a Package; it has a ParentID of 0. By iterating through all models, you can access all the elements within the project hierarchy.

You can also use the AddNew () function to create a new model. A model can be deleted, but remember that everything contained in the model is deleted as well.

Geert

PS. I hope you do realize that a model can have multiple roots, and that you have to iterate the collection to get to the actual root packages

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Knowing Project NAME
« Reply #4 on: April 25, 2015, 12:38:00 am »
Quote
Sorry for that,,
but I did not get any root-name


Regards,
What does that picture show?

To get the roots user Repository.Models as Geert suggested. There can be multiple so it's a collection.

q.

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: Knowing Project NAME
« Reply #5 on: April 25, 2015, 01:07:45 am »


but OK, I got it, solved now ,,

Thanks :)