Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: cy.walker on August 27, 2018, 01:36:57 pm

Title: Anyone got a good example of displaying built-in & custom Compartments?
Post 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;

I have tried following the manual but have had no luck.
Any assistance greatly appreciate!  :)

Cheers,
Cy
Title: Re: Anyone got a good example of displaying built-in & custom Compartments?
Post by: Sunshine on August 27, 2018, 07:16:17 pm
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
Title: Re: Anyone got a good example of displaying built-in & custom Compartments?
Post by: Geert Bellekens on August 27, 2018, 08:22:57 pm
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
Title: Re: Anyone got a good example of displaying built-in & custom Compartments?
Post by: cy.walker on August 28, 2018, 06:09:08 am
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?
Title: Re: Anyone got a good example of displaying built-in & custom Compartments?
Post by: cy.walker on August 28, 2018, 06:51:54 am
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.

Code: [Select]
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. :-\
Title: Re: Anyone got a good example of displaying built-in & custom Compartments?
Post by: Geert Bellekens on August 28, 2018, 02:15:49 pm
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