Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: mateiacd on June 11, 2021, 11:23:26 pm
-
Hi
EA.Repository rep = ...; initialized before
EA.Diagram dia = rep.GetCurrentDiagram();
//dia.Update() or rep.SaveDiagram(dia.DiagramID) ?
Is there any difference between the two ?
Both should save the diagram to the database, hence no difference ?
-
I would think so. Not unusual for EA to have duplicate operations doing the same with differend names/parameters. The Save in contrast to update would include manual user changes. Depends on whether the user had a chance to touch the diagram while your script ran.
q.
-
- SaveDiagram saves the current unsaved (user) changes to the database.
- Diagram.Update() saves the changes made by your code to the database.
They are definitely not interchangeable
Geert
-
Geert is right. I ran a short test:
d = rep.GetCurrentDiagram()
d.name="test"
rep.savediagram(d.diagramid)
The name was not changed. I wouldn't have been astonished if it had, though.
q.