Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Jeremie on July 21, 2015, 07:20:54 pm
-
Hi everyone,
Is there a way to determine if the addin is launched from the top menu bar or from a right-click on a otElement/otDiagram/otPackage ?
Thanks a lot,
Jeremie.
-
yes
If you look for menuLocation parameter in the calls such as EA_GetMenuItems / Menustate / MenuClick - it is a string representing the part of the user interface that brought up the menu. This can be TreeView, MainMenu or Diagram.
If you right click on an item you will probably want to check the type of item as you will get an object (e.g. myObject = Repository.GetContextObject ) then if you are looking for an element you can use myObject.ObjectType = EA.ObjectType.otElement or similar for other item types
Hope that helps.
-
thanks a lot, i figured.
Quick question: how can you access messages from a sequence diagram ?
I tried DiagramLinks and DiagramObjects but no luck so far
-
It's the connectors collection. Too simple, I guess ;)
See my answer here: http://stackoverflow.com/questions/31584378/display-sequence-messages/31587227#31587227
q.
-
Thanks a lot qwerty :)