16
General Board / 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.");
}
}
}
}
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.");
}
}
}
}