Book a Demo

Author Topic: Can I use the same decoration for different tags?  (Read 2901 times)

peterc

  • Guest
Can I use the same decoration for different tags?
« on: October 10, 2019, 07:43:59 pm »
I would like to apply the same decoration for different tags. Obviously I could have two HasTag blocks with identical code, but I was hoping to be able to only write the definition once.

I have tried HasTag("Application","App1,App2"), mirroring the HasProperty option of matching multiple values, but that doesn't work (to be fair it was not documented!).

I have also tried defining a shape within my decoration block and adding that as a subshape, but the subshape does not appear in the decoration - should it, i.e. is addsubshape supported in a decoration or only in the main shape? This would require two HasTag blocks, but not the need to cut and paste identical code.

decoration application
{
  ...
  if (HasTag("Application","App1"))
  {
    addsubshape("Shape1");
  }
  shape Shape1
  {
    ...
  }
}

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Can I use the same decoration for different tags?
« Reply #1 on: October 10, 2019, 08:26:38 pm »
Shape script is about copy and paste. It's very "simplistic".

q.