Book a Demo

Author Topic: Tagged Values in Scripting  (Read 8606 times)

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Tagged Values in Scripting
« on: August 16, 2011, 01:01:25 am »
Hello! I'm not sure how I'd use a script (I'm scripting in JavaScript) to add a tagged value to an element.

Basically my script assembles an array of a certain type of element and then tags a value "true" or "false" based on its properties. I'm not sure how to add a new tagged value to an existing element, so that I can change it with this script (if it doesn't already exist).

If it's not trivial to add new tagged values, I could change the stereotype for the element (it's in a custom MDG) to create the element with a junk value for this tag, but I'd prefer to do it through the script.

Cheers,
Sam
Using EA 9.0.908 System Engineering Edition.

Fred Bevan

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Scripting
« Reply #1 on: August 16, 2011, 01:55:09 am »
Have a look in the "Element Extras" sample script. It has a section that includes code for adding tagged values.

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Re: Tagged Values in Scripting
« Reply #2 on: August 17, 2011, 01:27:04 am »
Thanks! I've got it working now!
Using EA 9.0.908 System Engineering Edition.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Tagged Values in Scripting
« Reply #3 on: August 17, 2011, 02:07:57 am »
I beleive there is a JavaScript example that shows you have to do this. Have a look in EA under View->Scripting -> Local Scripts -> JScript - Element Extras Example - line 176 onwards....

Regards,

Jon.