Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Jeremie on July 21, 2015, 07:20:54 pm

Title: How to know where the addin is launched from ?
Post 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.
Title: Re: How to know where the addin is launched from ?
Post by: EXploringEA on July 23, 2015, 04:49:30 am
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.



Title: Re: How to know where the addin is launched from ?
Post by: Jeremie on July 23, 2015, 09:51:14 pm
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
Title: Re: How to know where the addin is launched from ?
Post by: qwerty on July 23, 2015, 09:54:19 pm
It's the connectors collection. Too simple, I guess  ;)
See my answer here: http://stackoverflow.com/questions/31584378/display-sequence-messages/31587227#31587227

q.
Title: Re: How to know where the addin is launched from ?
Post by: Jeremie on July 23, 2015, 10:50:07 pm
Thanks a lot qwerty  :)