Author Topic: show  inherited tags in custom elements  (Read 7781 times)

alexM

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
show  inherited tags in custom elements
« on: November 25, 2014, 01:35:40 am »
I'm realizing a custom profile and I'm writing a shape script for each stereotype , the my question is:  is there any function, to use in a  stereotype shape script, to show inherited tags (like "HasTag()" for 'simple' tag)?  

Thanks a lot !

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re:  show  inherited tags in custom elements
« Reply #1 on: November 25, 2014, 03:49:12 am »
The HasTag("<tv>") and HasTag("<tv>", "<value>") works only on TVs for the very element. It does not recognize inherited TVs. You might use the addin-escape like
Code: [Select]
hasproperty('addin:myAddIn,TVtest','TVname')to do that in an addin.

q.

alexM

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re:  show  inherited tags in custom elements
« Reply #2 on: November 25, 2014, 08:28:46 pm »
Thank you very much for your answer.

I do not have much familiarity with the "add-in" topic,  can you give me any reference on which to go into that ?!


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re:  show  inherited tags in custom elements
« Reply #3 on: November 25, 2014, 09:08:25 pm »
I for myself had implemented it only once or twice to see it's working. YOu need to write an addin in the language of your choice and implement any method (in the example it's TVtest). EA will then can call this method and supply the parameters (in above example there are not parameters, you'd need to supply them comma-separated after the function name) to be processed. In return a string is expected which you can use in a print statement inside the shape script, e.g.
Code: [Select]
print("#addin:myAddIn,pFunc1#")Geert Bellekens has a blog about how to write an addin (in some Cxx) which is recommended by many people. Honestly I haven't read it since I made my way earlier on a very different path :D but even without reading I can recommend it.

q.
« Last Edit: November 25, 2014, 09:56:08 pm by qwerty »

alexM

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re:  show  inherited tags in custom elements
« Reply #4 on: November 25, 2014, 09:22:45 pm »
thank you so much for the advice!  :)