Author Topic: VBS Script to go through all composite diag elt  (Read 4156 times)

bachus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
VBS Script to go through all composite diag elt
« on: December 15, 2014, 11:03:51 pm »
Hello UML guru out there,

I'm struggling to create my vbs script to go through all the elements of my diagram and the elements of the composite diagrams.

My idea is to applied a scrip on Package as the one in the picture bellow.
The script should check all the elements of all the diagrams.



I've managed to checks the elements of each diagram independently, but not for the composite diagram

Do you have an idea how to do it ?

Thanks in advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: VBS Script to go through all composite diag el
« Reply #1 on: December 16, 2014, 12:08:11 am »
I don't see where the problem is :-?

Can't you find the composite diagram or do you have trouble iterating its elements?

q.

bachus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: VBS Script to go through all composite diag el
« Reply #2 on: December 16, 2014, 12:29:46 am »
Hello,

Sadly I will answer yes at your two question...  :-/
In a nutshell, I don't know how to write my script to iterate through all the elements of my package (including composite diagrams).

I tried to iterate the Package element's with
Code: [Select]
Repository.GetTreeSelectedPackage()
But It wasn't successful.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: VBS Script to go through all composite diag el
« Reply #3 on: December 16, 2014, 04:52:41 am »
To access the composite diagram you need EAElement.CompositeDiagram

To iterate to the elements in a diagram use EADiagram.DiagramObjects. The returned collection of diagram objects will allow to access the EAElement via Repository.GetElementByID. Note that you will also find Notes, Boundaries and other stuff you might need to ignore.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: VBS Script to go through all composite diag el
« Reply #4 on: December 16, 2014, 05:01:12 pm »
In your example:

pkg.Elements - will return Class1, Component1, Component2
pkg.Diagrams - will return pkg1

To get the child elements and diagrams you need to recursively call

elem.Elements
elem.Diagrams