Book a Demo

Author Topic: Element in focus in menu click  (Read 3191 times)

fferm

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Element in focus in menu click
« on: December 14, 2010, 08:05:45 pm »
I'm creating a function that will run as a result of a menu click through the EA_MenuClick event.

When the user clicks this menu item, I want updates to happen to all elements in the model in focus, i e not the full set of models but only the one that the user previously worked in.

How can I find out what the element in focus is from the menu click.  I only get a reference to the full repository and I did not find any way to find the focus from there.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Element in focus in menu click
« Reply #1 on: December 14, 2010, 09:37:41 pm »
Repository.GetTreeSelectedItem (object SelectedItem) gives you the selected item in the project tree.
From there you should be able to figure out which model is being used.
(go up until package.Element is NULL or check Package.IsModel, but I'm not sure about the latter)

Geert