Author Topic: Anyone got a good example of displaying built-in & custom Compartments?  (Read 3774 times)

cy.walker

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
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

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Anyone got a good example of displaying built-in & custom Compartments?
« Reply #1 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 for examples
and page 164 of the MDG technologies guide
http://www.sparxsystems.com/resources/user-guides/modeling/mdg-technologies.pdf for more details
« Last Edit: August 27, 2018, 07:18:26 pm by Sunshine »
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Anyone got a good example of displaying built-in & custom Compartments?
« Reply #2 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

Geert

cy.walker

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Anyone got a good example of displaying built-in & custom Compartments?
« Reply #3 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?

cy.walker

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Anyone got a good example of displaying built-in & custom Compartments?
« Reply #4 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. :-\

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Anyone got a good example of displaying built-in & custom Compartments?
« Reply #5 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