Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: cy.walker on August 27, 2018, 01:36:57 pm
-
Hi everyone,
I'm looking for a working example of the below for both Class and Package based elements override with shape script;
- displaying EA built-in Compartments
creating & displaying custom Compartments
I have tried following the manual but have had no luck.
Any assistance greatly appreciate! :)
Cheers,
Cy
-
You can create a stereotype and associate a shapescript with that stereotype. The shape script can create custom compartments. See http://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/example_scripts.html (http://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/example_scripts.html) for examples
and page 164 of the MDG technologies guide
http://www.sparxsystems.com/resources/user-guides/modeling/mdg-technologies.pdf (http://www.sparxsystems.com/resources/user-guides/modeling/mdg-technologies.pdf) for more details
-
Here's a bunch of shapescript samples that might help:
https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library (https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library)
Geert
-
Thanks.
Geert - as I am not 100% on what I am looking for & there is a LOT of shapes in your library, is there any particular shape that you might recommend as a good example?
-
The below is the test I am attempting unsuccessfully.
root type is class & has custom stereotype + shape script applied.
if only have ChildElement it reverts to the default class shape & "MyIDCompartment" is not an available in the visability list.
if I have main then ChildElement still does not display or available in visibility list.
shape main {
setlinestyle("dash");
roundrect(0, 0, 100, 100,20,20);
println("TEST");
}
shape ChildElement {
SetCompartmentName("MyIDCompartment");
addsubshape("id",100,15);
addsubshape("name",100,15);
shape id {
scalable = "false";
println("#TAG:HEG::ID#.#version#");
}
shape name {
bold = "true";
println("#name#");
}
}
Sorry, I'm having trouble getting my head around this. :-\
-
Thanks.
Geert - as I am not 100% on what I am looking for & there is a LOT of shapes in your library, is there any particular shape that you might recommend as a good example?
I can't really. Only a few were written by me. The others were extracted from existing the Sparx MDG technologies.
Geert