Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Arnoud_B on May 11, 2022, 05:08:47 pm
-
In the GUI you can easily add a ChildDiagram to an Element by using "New Child Diagram" either by creating a new Diagram with "Composite Structure Diagram" or linking an existing with "Select Composite Diagram".
I am generating a skeleton set of Diagrams based on my model and I would like to link the created diagrams to 'their' Element. However in the API the attribute CompositeDiagram is Readonly
Notes: Read only
If the element is Composite, returns its associated diagram; otherwise returns null.
Diagram Class
Also from the other side; Diagram object I do not find a way to set this, anybody did this before?
-
Hi Arnaud,
Here's a post that will interest you: https://sparxsystems.com/forums/smf/index.php/topic,40558.msg247781.html#msg247781 (https://sparxsystems.com/forums/smf/index.php/topic,40558.msg247781.html#msg247781)
Geert
-
Thanks Geert,
Well actually the SetCompositeDiagram() works in my case so I do not have to use your more dangerous query solution.
I am a bit ashamed to say that I just did not scroll down enough in the help text to find this myself.
In my defense I have now completed a kickstart script that will generate a basic set of diagrams with navigation between them based on an well structure model.
It is really amazing at times what you can do with the scripts although it is hard to get them dummy proof, as a mistake in your script (or in my case an unanticipated use of a script in a different context) can do a lot of harm to your repository. So my kickstart script is heavy user only ;-)
-
(or in my case an unanticipated use of a script in a different context)
I feel your pain. I even wrote safety guards in some scripts that allow them to be executed only by a few users.
Geert