Book a Demo

Author Topic: GetObjectByID  (Read 4105 times)

Danny F

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
GetObjectByID
« on: December 06, 2012, 06:22:00 pm »
Hi

I'm working with EA 9.2
Trying to react on a  'EA_OnPostNewDiagramObject' event.
Documentation tells me :
- EventProperties contain the ObjectID
- I should retrieve the object using Repository.GetObjectByID(...)

However : Repository.GetObjectByID() is not available ?!

All help appreciated

thanks
« Last Edit: December 06, 2012, 06:22:29 pm by dannyf »
Reg.

Danny

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GetObjectByID
« Reply #1 on: December 06, 2012, 07:19:10 pm »
Danny,

My help file doesn't mention getObjectByID.

It does say:

Quote
Contains the following EventProperty objects for the new element:

· ObjectID: A long value corresponding to Object.ObjectID

My guess (but you'll have to test it) is that ObjectID is in fact the element ID, and you can use it in Repository.GetElementByID() to retrieve the element that is being represented by the DiagramObject.

Geert
  
« Last Edit: December 06, 2012, 07:19:45 pm by Geert.Bellekens »

Danny F

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: GetObjectByID
« Reply #2 on: December 06, 2012, 08:17:59 pm »
Geert,
that works :)

still leaves me with the feeling that this is not as robust as it should be.


BTW on several places in the doc you'll find :
Quote
ObjectID .... The ID of the object .... . Use the
Repository.GetObjectByID method to retrieve the object

Thanks for the reply

Reg.

Danny

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GetObjectByID
« Reply #3 on: December 06, 2012, 08:27:48 pm »
Who said anything about robust?  ;D

No seriously I indeed found three more references to the non-existent Repository.GetObjectByID.

If you mention that to Sparx I'm sure they will fix the documentation.

Geert