Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Geert Bellekens on March 17, 2012, 12:38:39 am
-
Does anyone have ready made code to copy a sequence diagram?
From what I see now I'll have to:
- copy owned elements (notes and fragments)
- copy diagramObjects
- copy messages
- copy diagramLinks
Geert
-
If the Sequence diagram is alone into a Package containing the diagram and the collaborating objects (instances of classes), then use the "Package.Clone()" method.
Else, if the diagram is under an "Interaction" object containing the diagram & objects, move temporarily the Interaction (Element.PackageID) to a temp package, clone it, and relocate the Interaction object.
Regards,
-
Thanks Luis,
That is a great workaround!
(I sort of feel bad that I didn't think of it :-[)
Geert