Book a Demo

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

Prev Next

Connect to the Interface

All development environments capable of generating ActiveX Com clients can connect to the Enterprise Architect Automation Interface.

By way of example, these sections describe how to connect using several such tools. The procedure might vary slightly with different versions of these products.

Microsoft Visual Basic 6.0

This procedure caters for the syntax and frameworks of version 6.0. More recent versions have the same framework as other .Net languages with only syntax differences, and therefore use a similar process to that described for Microsoft C#, later in this topic.

Step

Action

See also

1

Create a new project.

2

Select the 'Project | References' menu option.

3

Select Enterprise Architect Object Model 2.0 from the list.

If this does not appear, go to the command line and re-register Enterprise Architect using:

      EA.exe /unregister

then

      EA.exe /register

4

See the general library documentation on the use of Classes. This example creates and opens a repository object:

      Public Sub ShowRepository()

            Dim MyRep As New EA.Repository

            MyRep.OpenFile "c:\eatest.eap"

      End Sub

Borland Delphi 7.0

Note that recent versions of Delphi are developed by Embarcadero.

Step

Action

See also

1

Create a new project.

2

Select the 'Project | Import Type Library' menu option.

3

Select Enterprise Architect Object Model 2.0 from the list.

If this does not appear, go to the command line and re-register Enterprise Architect using:

      EA.exe /unregister

then

      EA.exe /register

4

Click on the Create Unit button.

5

Include EA_TLB in Project1's Uses clause.

6

See the general library documentation on the use of Classes. This example creates and opens a repository object:

      procedure TForm1.Button1Click(Sender: TObject);

      var

      r: TRepository;

      b: boolean;

      begin

      r:= TRepository.Create(nil);

      b:= r.OpenFile('c:\eatest.eap');

      end;

Microsoft C#

Step

Action

See also

1

Select the 'Visual Studio Project | Add Reference' menu option.

2

Click on the 'Browse' tab.

3

Navigate to the folder in which you installed Enterprise Architect; usually:

      Program Files/Sparx Systems/EA

Select

      Interop.EA.dll

4

See the general library documentation on the use of Classes. This example creates and opens a repository object:

      private void button1_Click(object sender, System.EventArgs e)

      {

      EA.Repository r = new EA.Repository();

      r.OpenFile("c:\\eatest.eap");

      }

Java

Step

Action

See also

1

Copy the file:

      SSJavaCOM.dll

from the Java API subdirectory of your installed directory, usually:

      Program Files/Sparx Systems/EA

into any location within the Windows PATH

      windows\system32 directory.

Note: The Java API loads the last installed Enterprise Architect and isn't affected when using either the 32 or 64 Version of DLL, as long as the SSJavaCOM dll can be found by the java runtime.

2

Copy the file

      eaapi.jar

from the Java API subdirectory of your installed directory, usually:

      Program Files/Sparx Systems/EA

to a location in the Java CLASSPATH or where the Java class loader can find it at run time.

3

All of the Classes described in the documentation are in the Package org.sparx. See the general library documentation for their use. This example creates and opens a repository object:

      public void OpenRepository()

      {

      org.sparx.Repository r = new org.sparx.Repository();

      r.OpenFile("c:\\eatest.eap");

      }

Reference