Author Topic: Open diagram and go to selected object  (Read 8268 times)

masstq

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Open diagram and go to selected object
« on: June 22, 2012, 07:18:55 pm »
Hi,
I want to use same functionality as in Find in Diagrams, so I want to open diagram, set perspective at some object and select it. Is it possible?

Thanks,

Artur

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #1 on: June 22, 2012, 07:46:41 pm »
Yes, this is possible.

masstq

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #2 on: June 22, 2012, 07:49:06 pm »
Could You give me some tips, how it can be done?

Thanks,
Artur

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #3 on: June 22, 2012, 08:57:19 pm »
Take a look at the EA Automation API reference:
http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/reference.html

With the Repository object there's a call for
* OpenDiagram (long DiagramID)
Selecting an Element or Connector must be possible using automation as well (I've already seen that), just don't know the method to use now.

HTH
Günther

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Open diagram and go to selected object
« Reply #4 on: June 22, 2012, 09:06:01 pm »
From my book:
Quote
EaCollection SelectedObjects— Returns a collection representing the currently selected elements on the diagram. You can remove objects from this collection to deselect them, and add elements to the collection by passing the Object ID as a name to select them.

q.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #5 on: June 22, 2012, 10:22:47 pm »
Time to buy your book q.  ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Open diagram and go to selected object
« Reply #6 on: June 22, 2012, 11:25:31 pm »
You guessed it :-) That's why I advert here...

q.

masstq

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #7 on: June 23, 2012, 12:05:31 am »
Ok, selection works, but how to set focus on object? I mean, the same how the Find in Diagrams works when we press Ctrl+U on selected object and then open a diagram with focus on that object.

Artur

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Open diagram and go to selected object
« Reply #8 on: June 23, 2012, 12:51:28 am »
Isn't that written in my post? Or does it not work for you?

q.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #9 on: June 23, 2012, 08:57:22 am »
i guess what he wants is not possible.
focus on object = center the selected diagram on that element.
(i opened a thread some time ago with this requirement but it seems that its not possible)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Open diagram and go to selected object
« Reply #10 on: June 23, 2012, 10:34:01 pm »
If you want to move the diagram focus, this is indeed not possible.

q.

masstq

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Open diagram and go to selected object
« Reply #11 on: June 25, 2012, 08:00:52 pm »
I thought that it could be impossible, but it was worth trying. Thanks so much for help!

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1374
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Open diagram and go to selected object
« Reply #12 on: March 03, 2018, 02:03:29 am »
I take that the diagram focus is still not supported via the API?
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Open diagram and go to selected object
« Reply #13 on: March 03, 2018, 05:42:53 am »
I take that the diagram focus is still not supported via the API?

I do remember something reading something like that in the release notes, but I'm not sure.

Geert