Book a Demo

Author Topic: Listing Elements of a diagram  (Read 3461 times)

utilisateurEA

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Listing Elements of a diagram
« on: June 08, 2010, 11:55:00 pm »
Hello,

I would like to list all the elements used in a diagram with a script.
I tried EA.Diagram Diag and a Diag.DiagramObjects but it doesn't seem to be the right solution.
Do you know how I could list all the elements used in a diagram ?

Thank you

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Listing Elements of a diagram
« Reply #1 on: June 09, 2010, 09:29:04 am »
Define "all elements used in a diagram" and why .DiagramObjects doesn't do it for you...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

utilisateurEA

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: Listing Elements of a diagram
« Reply #2 on: June 09, 2010, 05:13:38 pm »

By "all elements used in a diagram" I mean all the elements displayed on a diagram, like an interface, a port, an actor, a dependency,... anything which is displayed on my diagram.


.DiagramObjects doesn't fit to me because when I write my script, exactly when I write Diag.DiagramObjects. I have the choice between operations (like Delete, Equals, GetHashCode) but no property(except ObjectType). So I deduced it wasn't the right solution
« Last Edit: June 09, 2010, 05:14:05 pm by utilisateurEA »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Listing Elements of a diagram
« Reply #3 on: June 09, 2010, 10:00:10 pm »
Caveat - the following applies to the Automation Interface - it may not apply to the Scripting Interface.  (I don't use it as I do more complex stuff that isn't readily amenable to scripting).

Firstly, lines (such as Dependency) are not DiagramObjects - they are DiagramLinks.

Secondly, both DiagramObjects and DiagramLinks are collections and so you need to use Gets (such as GetAt() or GetByName())  to return the items of the collection.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!