Book a Demo

Author Topic: Finding diagram messages from VB  (Read 3419 times)

novice user

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Finding diagram messages from VB
« on: September 01, 2008, 06:34:05 pm »
I would like to generate a list of all the messages in a diagram, using VBA.
The "Diagram" object does not have a "messages" method.
How can I find all the messages?
(I assume there are 2 methods - going over all the "DiagramObjects" of the diagram and finding which one is a connector, or going all the connectors in the repository and finding which one are connected to the diagram. Any recommendation of code fragments?)
Thanks

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Finding diagram messages from VB
« Reply #1 on: September 01, 2008, 09:35:38 pm »
Use the DiagramLinks collection and interrogate each.

You can also write a custom search and call that from automation.
No, you can't have it!

novice user

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Finding diagram messages from VB
« Reply #2 on: September 01, 2008, 10:13:19 pm »
The DiagramLinks of the diagram is empty.
Please note that the documentation claims that "A Diagram link is only created once a user modifies a connector in a diagram in some way. Until this condition has been met default values are used and the diagram link is not in use."

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Finding diagram messages from VB
« Reply #3 on: September 02, 2008, 01:29:37 am »
EA often draws connectors on the fly, so long as all parameters are set to the default values. [I guess that...] Doing it this way it does not require so much database interaction.

Still, there is a link there, or at the very least there is a Link object for each of the DiagramObjects (supplier and client) elements. You can look it up and set up a diagram link, then modify some (any) value. It will be saved. [NB: The diagram link might be saved if you set it up at all. I've not had to do this for a while, and the application I used was making them invisible on selected diagrams.]

HTH, David
No, you can't have it!

novice user

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Finding diagram messages from VB
« Reply #4 on: September 02, 2008, 01:36:20 am »
Using the diagram link object might have worked. I might test it.
In the meantime, I implemented something that goes over all the elements in the package, and for each one checks for all the connectors whether they are part of the diagram. Not efficient, but works.
Thanks for the answers.