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

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, the following 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

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. The following 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

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. The following 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. The following 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.

 

 

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. The following example creates and opens a repository object:
 

public void OpenRepository()

{

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

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

}

 

 

Reference