Search code examples
c#add-inenterprise-architect

How to access Operations and Attributes of a State Machine diagram element in Enterprise Architect using C#


I need to fetch the attributes and operations of diagram objects of a state machine diagram using C#. But I am not able to find those things neither inside the diagram nor inside the element itself


Solution

  • To get details of attributes and operation you need to loop through Attributes and Methods collection of element .

    For Attributes :

                foreach (EA.Attribute att in currentElement.Attributes)
                {
                }
    

    For Operations:

                foreach (EA.Method att in currentElement.Methods)
                {
                }
    

    Please refer Attributes and Operations for more deials