Author Topic: Adding a TAG value with the name of an element  (Read 3048 times)

Mats Gejnevall

  • EA User
  • **
  • Posts: 92
  • Karma: +1/-0
    • View Profile
Adding a TAG value with the name of an element
« on: June 17, 2021, 05:45:56 pm »
Hi
I want to add a add an identifier to the name of my elements when they are displayed in a diagram using a shape script. I have the identifier as a TAG. But I cannot find any way to do that. I can print the identifier on the element, but it should really be merged (in the display) with the name otherwise it will not stay in the same position when I enlarge or shrink the element. I do not want to show the TAG in a compartment since it increases the size of the element.

Can anyone show me how to do this? Must be a common way to handle identities.

Thanks
Mats


qwerty

  • EA Guru
  • *****
  • Posts: 12840
  • Karma: +367/-296
  • I'm no guru at all
    • View Profile
Re: Adding a TAG value with the name of an element
« Reply #1 on: June 17, 2021, 07:13:41 pm »
Well, basically you have to do ALL the drawings yourself. That is you print("#name#"); and print("#tag:yourtag#"); where it pleases you in a subshape. You can't find out where the native drawings went from a shape script.

q.

Mats Gejnevall

  • EA User
  • **
  • Posts: 92
  • Karma: +1/-0
    • View Profile
Re: Adding a TAG value with the name of an element
« Reply #2 on: June 17, 2021, 10:53:00 pm »
Thanks qwerty
If I use java scripts instead, would that do the job? Or I would still need to work with subshapes?

Cheers
Mats

qwerty

  • EA Guru
  • *****
  • Posts: 12840
  • Karma: +367/-296
  • I'm no guru at all
    • View Profile
Re: Adding a TAG value with the name of an element
« Reply #3 on: June 17, 2021, 11:08:25 pm »
Java is of no help. Sparx' shape script is a language of it's own and has as of yet no replacement. Anything you want to render differently on a diagram needs either a (programmable) shape script or a (static) image (and yes, I know that shape script can use static images as well).

q.