Book a Demo

Author Topic: Synchronizing EA Database and Addin-API  (Read 4509 times)

Andreas Morgenstern

  • EA User
  • **
  • Posts: 26
  • Karma: +1/-0
    • View Profile
Synchronizing EA Database and Addin-API
« on: September 23, 2014, 05:34:33 pm »
Hi,

Is there a way to synchronize the EA Database and the "Objects" provided by the API.
Assume I retrieved the root model with
Code: [Select]
root=Repository.Models.getAt(0)in an Addin
Clearly, I can change the name with
Code: [Select]
root.Name="Test" Updating the database can now be done with
Code: [Select]
root.Update()
But I don't know how to do accomplish this the opposite way. Is there a build-in method that reloads the content of the database?
I mean I can retrieve the root again from the database, but is there an automatic way to do it?

Thanks,

Andreas


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Synchronizing EA Database and Addin-API
« Reply #1 on: September 23, 2014, 06:43:53 pm »
You simply need to call GetAt once again.

You can not setup a hook watching for a foreign change. To do that you need to write a trigger in the database and some additional magic (at least I guess so since I never done something like that in reality).

q.
« Last Edit: September 23, 2014, 06:46:49 pm by qwerty »

Andreas Morgenstern

  • EA User
  • **
  • Posts: 26
  • Karma: +1/-0
    • View Profile
Re: Synchronizing EA Database and Addin-API
« Reply #2 on: September 24, 2014, 04:03:17 pm »
Ok,

thanks for your answer. I was expecting that after reading the API docu, but wanted to make sure.

Andreas