Book a Demo

Author Topic: API to select item form the diagram  (Read 4875 times)

ALL_IN_ONE

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
API to select item form the diagram
« on: September 03, 2009, 05:14:08 pm »
hello folks,

Is there any way to right click on the diagram to recognize the objects or items. For example we have the GetTreeSelectedItem API but it works fine if a user clicks on the project browser, thus what if a user selects an diagram object on the diagram . . . but I see in the manual there is no API as such? . . .

coder

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: API to select item form the diagram
« Reply #1 on: September 03, 2009, 06:19:06 pm »
Hi coder,

Take a look at the Context Item events in the EA AddIn SDK:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/context_item_events.html

HTH
Günther

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: API to select item form the diagram
« Reply #2 on: September 03, 2009, 08:40:42 pm »
I don't think mister all_in_one meant the events, but rather how to access the selected object, even when selected in a diagram.
The operation to do so is Repository.getContextItem()
Be careful though, there was a bug that made this operation behave incorrectly. I think it was fixed in 7.5.847 or 7.5.848.

Geert

Jude Ambrose

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: API to select item form the diagram
« Reply #3 on: September 10, 2009, 08:23:06 pm »
I too believe Geert is right . . .

cheers,
Jude ;)

ALL_IN_ONE

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: API to select item form the diagram
« Reply #4 on: September 10, 2009, 08:25:12 pm »
Thank you guys for your reply,

@Geert - havent tried yet, but will getr back once I have tried. Thanx for the information

Best regards
coder