Author Topic: Need SelectedDiagramLink and SelectedDiagramObjects for Diagram Class  (Read 172 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5637
  • Karma: +62/-40
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Increasingly, we are developing scripts that operate directly on the Selected Diagram Link (rather than the underlying Selected Connector).  Similarly with Diagram Objects.

However, there is no SelectedDiagramLink or SelectedDiagramObjects attributes for the Diagram Class.  We are forced to scan the appropriate collections to determine the diagram link from the underlying connector.

Can we have direct access to the diagram specific items?

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

Helmut Ortmann

  • EA User
  • **
  • Posts: 829
  • Karma: +32/-1
    • View Profile
Hi Paolo,

The DiagramObject you can get by GetDiagramObjectByID (long ID, string DUID). See: http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/diagram2.html

For DiagramLink you have to run through the collection DiagramLinks. I have made a function once and then call it.

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5637
  • Karma: +62/-40
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Hi Paolo,

The DiagramObject you can get by GetDiagramObjectByID (long ID, string DUID). See: http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/diagram2.html

For DiagramLink you have to run through the collection DiagramLinks. I have made a function once and then call it.

Kind regards,

Helmut
Thanks, Helmut, but I did, in fact, know both of those.

As I pointed out to the Sparxians when they replied "in simili modo"...  "GetSelectedObjects returns a DiagramObject, NOT an Object and why am I forced to re-traverse a collection to obtain an item which was used to return the SelctedConnctor (which IS a connector and NOT a diagram link).

So there are in fact two different defects covered by the report.

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