Author Topic: ShapeScript : hide name of element  (Read 4372 times)

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
ShapeScript : hide name of element
« on: January 19, 2017, 02:38:28 am »
Hi

I have a simple shapescript for a stereotype with metaclass "ObjectNode":

Code: [Select]
shape main
{
noshadow="true";
fixedAspectRatio="true";

SetFillColor(255,255,255);
defsize(20,20);
startpath();
moveto(50,0);
lineto(75,50);
lineto(50,100);
lineto(25,50);
lineto(50,0);
endpath();
//StrokePath();
FillAndStrokePath();
}

When I use this element, the shape is drawn as expected. BUT the name of the element is shown below the shape. How can I 'hide' the name?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: ShapeScript : hide name of element
« Reply #1 on: January 19, 2017, 10:55:02 am »
ObjectNode may use the Label subshape to render the name.  You can check by seeing if you can select the "label" and move it around.

Try:
Code: [Select]
Shape Label
{
    print ("");
}
to override the default Label Behaviour.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
Re: ShapeScript : hide name of element
« Reply #2 on: January 19, 2017, 08:48:22 pm »
Thanks Paolo! That's the solution indeed.

I just found the same answer in the MDG documentation :)

Quote
If you have an empty shape routine, it overrides the default; so, a blank 'shape label' prevents the creation of the
normal floating text label for elements that have them

My solution (same idea as Paolo's)
Code: [Select]
shape main {
// main code
}

shape label {
//empty label shape to prevent the name from showing on the diagram
}