Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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.
-
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.
-
Which api that could move element from package to another?
-
simply change the PackageID of the element and then update the element.
Geert
-
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
-
Hi,
I have resolved this popup message using Repository.RefreshModelView() API after each update.
-
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