Book a Demo

Author Topic: Some strange behaviour using tag values in shapes  (Read 5455 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Some strange behaviour using tag values in shapes
« on: November 27, 2014, 09:30:55 am »
Previously I have used #tag:some tag name# in my shape script for elements and it returns the value of the tagged value.

In the case where the tagged value is a RefGUID, it returns the NAME of the element to which the GUID points to.

However, if I do the EXACT same thing in the shape script for a connector, it returns the GUID Identifier rather than the name of the element which it points to.

Is there a way around this (without add ins) or am I pushing $hit up hill with a pair of chopsticks?

Cheers

Jays  :)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #1 on: November 27, 2014, 10:01:09 am »
What does your connector shape script look like? Mine looks like this

Code: [Select]
label middlebottomlabel
{
      print("#tag:mytag#");
}
where mytag is a RefGUID tagged value, and it displays the name of the referenced element in a floating text label.
The Sparx Team
[email protected]

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #2 on: November 27, 2014, 10:40:15 am »
It looks like this (with some extraneous stuff removed):

addsubshape("details2","S");

shape details 2
{
h_align = "center"
print("#NAME#\nFrom: #TAG:Interval Start#\n #Tag:Interval Finish#");
}


Cheers  :)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #3 on: November 28, 2014, 04:35:32 am »
Hey there KP

So I changed my shape script to match yours (even removed sub main) and still getting GUIDs.

Is this because I am using 9.3?

Cheers  :)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #4 on: November 28, 2014, 04:49:36 am »
Scratch that last question, I just migrated to 11 and still getting GUIDs  :(

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #5 on: November 28, 2014, 10:11:32 pm »
I tried above example and I get the name, not the guid. (V11)

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #6 on: December 11, 2014, 08:50:40 am »
Hey guys

I've copied KP's example verbatim and still I am getting GUIDs  :(

If I do the same thing within an element, the correct result ensues.
But on a connector, it just keeps popping on up with GUIDs.

Is there some setting that I might have accidentally set that could cause this crazy behaviour?


All suggestions gratefully received.

Jays  :)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Some strange behaviour using tag values in sha
« Reply #7 on: December 11, 2014, 08:41:04 pm »
No real idea, but try starting with a complete empty EAP with all MDGs/add-ins turned off. Then start turning them on one by one.

q.