Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: ahafez on September 02, 2016, 07:36:01 pm

Title: Exchange element between two EA models
Post by: ahafez on September 02, 2016, 07:36:01 pm
Is there an API to export/copy an element (e.g. Interface, Class, ..etc.) from an EA model to a different EA model using the same GUID?

Knowing that I don't need to export/copy the parent package that contains this element.
Title: Re: Exchange element between two EA models
Post by: qwerty on September 02, 2016, 08:44:35 pm
No direct way. You "could" do it this way:
- create a dummy package
- move the element in question to that
- export the package to XMI (look into the ProjectInterface)
- move the element back
- open the other EAP
- import the XMI

q.
Title: Re: Exchange element between two EA models
Post by: ahafez on September 03, 2016, 01:02:53 am
Which api that could move element from package to another?
Title: Re: Exchange element between two EA models
Post by: Geert Bellekens on September 03, 2016, 01:22:30 am
simply change the PackageID of the element and then update the element.

Geert
Title: Re: Exchange element between two EA models
Post by: ahafez on September 03, 2016, 03:46:36 am
Hi Geert,

Many thanks, it works, but with every change I receive a popup message box as following:
---------------------------
Enterprise Architect
---------------------------
Warning: Underlying model data may have been modified by another user.

Press OK to refresh.
---------------------------
OK   
---------------------------

Is there is a way to suppress this message box?

Thanks,
---
Ahmed
Title: Re: Exchange element between two EA models
Post by: ahafez on September 03, 2016, 04:00:25 am
Hi,

I have resolved this popup message using Repository.RefreshModelView() API after each update.
Title: Re: Exchange element between two EA models
Post by: Uffe on September 05, 2016, 05:39:20 pm
Hello Ahafez,

The reason you're getting that popup is that the EA client detects that its display is out of sync with the data in the model database. This often happens when you're making changes using the API.

RefreshModelView() refreshes the display and thus solves the problem.

/Uffe