Author Topic: How to get stereotypes fully qualified name?  (Read 2561 times)

ea0921

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-1
    • View Profile
How to get stereotypes fully qualified name?
« on: October 19, 2023, 05:47:14 pm »
I have created Element with some stereotypes of different profile.
I am using interop.ea.dll to work with EA soap apis.
 
Here element's `FQStereotype` attribute only returns value for first stereotype.
and element's `StereotypeEX` attribute only returns list of stereotypes normal names not fully qualified stereotype names.
 
So, is there any mechanism to get all the stereotypes of element with its fully qualified name?
 
Code we used to get stereotypes values:
 

using System;
using System.Runtime.InteropServices;
using EA;
 
namespace EAInteropExample
{
    class Program
    {
        static void Main(string[] args)
        {
         String entityGuid = ##;

            // Connect to Enterprise Architect
            Repository repository = ConnectRepo();
 
            // Ensure that the repository is open
            if (repository.IsProjectOpen)
            {
            Element element = repository.GetElementByGuid(entityGuid)
            if (element != null){
               Console.WriteLine(element.FQStereotype);
               Console.WriteLine(element.StereotypeEx);
            }
 
                // Close the repository
                Marshal.ReleaseComObject(repository);
            }
            else
            {
                Console.WriteLine("Enterprise Architect project is not open.");
            }
        }
    }
}

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13283
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to get stereotypes fully qualified name?
« Reply #1 on: October 19, 2023, 07:03:05 pm »
You'll have to get the info from t_xref using Repository.SQLQuery

Geert