Book a Demo

Author Topic: ShapeScript Image from TaggedValue, Possible ?  (Read 4976 times)

dge98753

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
ShapeScript Image from TaggedValue, Possible ?
« on: January 05, 2024, 10:00:30 pm »
Hello,

Do you think it is possible to display an image depending on a tagged value without if/else testing ?
Here is what I test in a ShapeScript but it does not works.
Code: [Select]
image("#TAG:MyTaggedValue#", 0, 0, 100, 100);
The element has a TaggedValue named "MyTaggedValue" that contains a string that corresponds to the name of an image loaded into the image library.
But the image is not displayed.
Does someone have an idea why ?
It looks like if the macro is not resolved into the image function.
« Last Edit: January 06, 2024, 08:13:31 pm by dge98753 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ShapeScript Image from TaggedValue, Possible ?
« Reply #1 on: January 05, 2024, 10:25:38 pm »
I'm not sure, but I would expect that it isn't possible.

Shapescript pretty limited in functionality, partly because it needs to be super fast.
Getting an image based upon a tagged value cannot be cached (as is possible with hardcoded image names)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: ShapeScript Image from TaggedValue, Possible ?
« Reply #2 on: January 05, 2024, 10:33:53 pm »
I think the only way is to have all possible images in a (long) if-the-else nesting to test different tag values. But dynamically: pretty sure this isn't possible.

q.

dge98753

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: ShapeScript Image from TaggedValue, Possible ?
« Reply #3 on: January 06, 2024, 08:12:46 pm »
Thank you very much for your feedback