Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: utilisateurEA on June 08, 2010, 11:55:00 pm

Title: Listing Elements of a diagram
Post by: utilisateurEA 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
Title: Re: Listing Elements of a diagram
Post by: Paolo F Cantoni 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
Title: Re: Listing Elements of a diagram
Post by: utilisateurEA 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
Title: Re: Listing Elements of a diagram
Post by: Paolo F Cantoni 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