Author Topic: How to know where the addin is launched from ?  (Read 4139 times)

Jeremie

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
How to know where the addin is launched from ?
« 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.
« Last Edit: July 21, 2015, 07:21:11 pm by Jeremie »

EXploringEA

  • EA User
  • **
  • Posts: 172
  • Karma: +8/-0
    • View Profile
Re: How to know where the addin is launched from ?
« Reply #1 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.



EXploringEA - information, utilities and addins

Jeremie

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to know where the addin is launched from ?
« Reply #2 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to know where the addin is launched from ?
« Reply #3 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.
« Last Edit: July 23, 2015, 10:25:23 pm by qwerty »

Jeremie

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to know where the addin is launched from ?
« Reply #4 on: July 23, 2015, 10:50:07 pm »
Thanks a lot qwerty  :)