Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: masstq 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
-
Yes, this is possible.
-
Could You give me some tips, how it can be done?
Thanks,
Artur
-
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
-
From my book:
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.
-
Time to buy your book q. ;)
-
You guessed it :-) That's why I advert here...
q.
-
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
-
Isn't that written in my post? Or does it not work for you?
q.
-
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)
-
If you want to move the diagram focus, this is indeed not possible.
q.
-
I thought that it could be impossible, but it was worth trying. Thanks so much for help!
-
I take that the diagram focus is still not supported via the API?
-
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