Book a Demo

Author Topic: Get GUID of Item Selected in Diagram or Property  (Read 4800 times)

JonathanBB

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Get GUID of Item Selected in Diagram or Property
« on: October 27, 2006, 12:35:58 pm »
I need to use the Automation Interface to get the GUID of a selected item, such as
- a Connector/Link to an Element or
- a Requirement that is internal to a Use Case.

I can only find the EA.Project.getTreeSelectedItem method which gets the GUID of one Item selected in the Project Browser.

However, I can't find a method to get the GUID of an Item selected, for example in a Diagram or a Properties Editor, or the Hierarchy View. I find it necessary to use these other "views" because the Project Browser does not display the types of Item which I want to select (they are generally sub-items of Elements) .

Can I display more types of Item in the Project Browser?
Can I get the GUID of an Item selected in a view other than the Project Browser?
Am I missing something?  ???

Any suggestions gratefully received.

Thanks,
Jonathan Beebe

mailto:[email protected]

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Get GUID of Item Selected in Diagram or Proper
« Reply #1 on: October 29, 2006, 01:15:40 pm »
EA.Repository.GetContextItem() works the same way as getTreeSelectedItem but works for items selected in Diagrams too.  There is also EA.Diagram.SelectedObjects.

So, Repository.GetCurrentDiagram().SelectedObjects will get the objects selected on the current diagram.