Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: ea0522 on November 26, 2024, 11:14:29 pm
-
Using a JavaScript, I can create a diagram showing the elements I'm interested in.
However, by default, the diagram shows some compartments of the elements resulting in a rather messy diagram with elements of different sized (large) object boxes.
I can make the diagram look nicer using a property of the diagram using "Diagram Properties => Elements => Show Compartments" and then ticking or unticking the desired compartments, e.g. do not tick the Attributes compartment.
Now I would like to know how to set this diagram property using my JavaScript.
Thanks.
-
Probably in the StyleEx columns somewhere.
Geert
-
Thanks for the quick reply and suggestion Geert.
Did some testing and it looks like it is stored in the PDATA column.
Now the next issue arises, as I cannot find how to set the value for this from JavaScript...
It seems not to be a property of the EA.Diagram object.
-
Yeah, you might need to an sql update statement with Repository.Execute
Geert
-
Found a solution I would like to share:
// Set the properties of curDiagram as EA.Diagram
curDiagram.HighlightImports = false; // Hides the Namespace of Elements
curDiagram.ExtendedStyle = "HideAtts=1;"; // Hides the Attribute compartment of Elements
curDiagram.StyleEx = "HideConnStereotype=1;"; // Hides the Stereotype Labels of Connectors
curDiagram.Update();
Works for me in JavaScript.
Thanks to Geert for pointing in the right direction.
-
Nice.