Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Create a Custom View

A custom view must be designed as an ActiveX Custom Control and inserted via the Automation Interface. ActiveX Custom Controls can be created using most well-known programming tools, including Microsoft Visual Studio. See the documentation provided by the relevant vendor on how to create a custom control to produce an OCX file.

Once the custom control has been created and registered on the target system, it can be added through the AddTab() method of the Repository object. While it is possible to call AddTab() from any automation client, it is likely that you would call it from an Add-In, and that the Add-In is defined in the same OCX that provides the custom view.

This is a C# code example:

       public class Addin

       {

            UserControl1 m_MyControl;

            public void EA_Connect(EA.Repository Rep)

            {

            }

            public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)

            {

                 if(MenuName == "")

                       return "-&C# Control Demo";

                 else

                 {

                      String() ret = {"Show Custom View", "Show Button"};

                      return ret;

                 }

            }

            public void EA_MenuClick(EA.Repository Rep, string Location, string MenuName, string ItemName)

            {

                 if(ItemName == "Show Custom View")

                      m_MyControl = (UserControl1) Rep.AddTab("C# Demo","ContDemo.UserControl1");

                 else if(ItemName == "Show Button")

                      m_MyControl.ShowButton();

            }

       }

Learn more