Book a Demo

Author Topic: Shape Script: Adding letter in top left corner  (Read 5696 times)

Eamonn John Casey

  • EA User
  • **
  • Posts: 110
  • Karma: +0/-1
    • View Profile
Shape Script: Adding letter in top left corner
« on: March 12, 2018, 08:26:23 pm »
Hi,
I am using ArchiMate v3 and one of the things in the specification is placing a letter in the top left corner to signify which layer the element belongs to. I am New to schape scripting but don't know where to start.
I have added Project Template Package as in the documentation buut need now to change the script.

Thinking maybe something like:
Code: [Select]
drawnativeshape()
orientation = ne
print("A")

Which menu in Enteprrise Architect v13.5 need I be using?

Thanks,
Eamonn J.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Shape Script: Adding letter in top left corner
« Reply #1 on: March 12, 2018, 08:33:16 pm »
Hi Eamonn,

If you're working in-project (as opposed to with a modelled profile), the Uml Types config dialog is in Configure -- Reference Data (on the right).
In there, you can set a shape script for a selected stereotype.

As to the script, you should probably do a decoration instead of adding the letter to the main script.
Code: (shape script) [Select]
shape main {
    DrawNativeShape();
}
decoration LetterA {
    orientation = "NE";
    print("A");
}

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Eamonn John Casey

  • EA User
  • **
  • Posts: 110
  • Karma: +0/-1
    • View Profile
Re: Shape Script: Adding letter in top left corner
« Reply #2 on: March 12, 2018, 10:17:53 pm »
Thanks for the post.

Almost got it working. In UML Types I got Base Class set to class. That is the same base class for ArchiMate3: Components. But the shape script will only draw when I remove the ArchiMate3 stereotype from the Component.

Seems like ArchiMate3 shape script hides the rengering I am trying to do.

EjC
« Last Edit: March 12, 2018, 10:38:09 pm by Eamonn John Casey »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape Script: Adding letter in top left corner
« Reply #3 on: March 12, 2018, 11:30:00 pm »
EjC,

You cannot overrule Archimate shapescripts. Whatever you define will always be something "next to" Archimate's shapescript.

If you want to change Archimate shapes then you would have to make a stereotype that extends the Archimate stereotype, and assign a shapescript to that stereotype.

You would then need to use your stereotype instead of the standard Archimate stereotype.

The other option is to edit the Archimate xml and replace the standard shapescript with your own shapescript into that, but that is a bit of a hack.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Shape Script: Adding letter in top left corner
« Reply #4 on: March 13, 2018, 09:11:08 am »
Define your stereotype as extending the ArchiMate stereotype.

Code: [Select]
shape main {
    DrawParentShape();
}
decoration LetterA {
    orientation = "NE";
    print("A");
}

Also, you may be interested in Redefine Stereotypes in Another Profile