Author Topic: How to set Multiple Stereotypes on one EA.Element?  (Read 1520 times)

nikunj-dhamecha

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
How to set Multiple Stereotypes on one EA.Element?
« on: January 19, 2023, 11:32:51 pm »
Hello Everyone,
I have one query on the way multiple stereotypes are set on an element using C# API.
I am using EA 16 with C# API, trying to create multiple types of elements(Different Metaclasses), I want to set multiple stereotypes,
let's say for a Class, I want to set two different stereotypes i.e. block and constraintBlock

The issue is if only one stereotype is passed, its shown in the application under a respective element, but If more than one stereotype is being assigned to one element, then no stereotypes are shown under the respective element.

What am I doing wrong here? Do I have to set some other properties as well?
Any pointers would be helpful, Thanks!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to set Multiple Stereotypes on one EA.Element?
« Reply #1 on: January 20, 2023, 12:00:31 am »
In most cases it's not a good idea to use multiple stereotypes.
A lot of things (like shapescripts) are not very well equiped to handle that.

In your case, it look to me like a constraintBlock is (or should be) a specialized (meta) type of block. So you can use stereotype inheritance in the your profile to model that, and use only constraintBlock as stereotype.

Apart from the advice, you can set multiple stereotypes using the property EA.Element.StereotypeEx: passing comma separated stereotype names.

Geert

nikunj-dhamecha

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to set Multiple Stereotypes on one EA.Element?
« Reply #2 on: January 23, 2023, 11:13:45 pm »
Thanks Geert for the reply.
It worked for me after inserting "," between two stereotypes! :)