I just tested it using native xml package import, gui and ImportPackageXMI.
In both cases sparx preserves object_id and guid of the updated elements, you have to make sure to deselect Strip GUID.
The exact sparx version is 16.0.1604
import win32com.client
try:
repo = win32com.client.Dispatch("EA.Repository")
print(repo.OpenFile(r"C:\must-be-absolute-path\for-gregor-target.qeax"))
print(repo)
project = repo.GetProjectInterface()
print(project)
error = project.ImportPackageXMI(
PackageGUID="{7D0CD74B-DA8A-44b9-AB02-9D129B3071EC}", # this is guid of the existing package to be updated
Filename=r"C:\redacted-full-path\adim1-v1.1.xml", # this is native xml with package file where root Package element has matching guid attribute
ImportDiagrams=True,
StripGUID=False, # translates to "update" existing
)
print(error)
finally:
repo.CloseFile()
repo.Exit()
<?xml version="1.0" encoding="windows-1252" standalone="no"?>
<Package name="adim1" guid="{7D0CD74B-DA8A-44b9-AB02-9D129B3071EC}">
<Table name="t_package">
<Row>
<Column name="Package_ID" value="7"/>
<Column name="Name" value="adim1"/>
...