Project Class

The Project interface can be accessed from the Repository using GetProjectInterface(). The returned interface provides access to the XML-based Enterprise Architect Automation Interface. Use this interface to get XML for the various internal elements and to run some utility functions to perform tasks such as load diagrams or run reports.

Project Attributes

Attribute

Type

Notes

ObjectType

ObjectType

Read only

Distinguishes objects referenced through a Dispatch interface.

 

Project Methods

Method

Type

Notes

See also

CancelValidation ()

Void

Cancels a validation process.

 

 

Model Validation

CanValidate ()

Boolean

Returns a value to indicate that the Model Validation component is loaded.

 

CreateBaseline (
string PackageGUID,
string Version,
string Notes)

Boolean

Creates a Baseline of a specified package.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to Baseline
Version: String - the version of the Baseline
Notes: String - any notes concerning the Baseline

 

 

CreateBaselineEx (
string PackageGUID,
string Version,
string Notes,
EA.CreateBaselineFlag Flags)

Boolean

Creates a Baseline of a specified package, with a flag to exclude package contents below the first level.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to be Baselined
Version: String - the version of the Baseline
Notes: String - any notes concerning the Baseline
Flags: EA.CreateBaselineFlag - whether or not to exclude the package contents below the first level

 

Create Baselines

EA.CreateBaselineFlag

DefineRule (
string CategoryID,
EA.EnumMVErrorType ErrorType,
string ErrorMessage

String

Defines the individual rules that can be performed during model validation. It must be called once for each rule from the EA_OnInitializeUserRules broadcast handler.

The return value is a RuleId, which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation.

See the Model Validation Example for a detailed example of the use of this method.

Parameters:

CategoryId: String - should be passed the return value from the DefineRuleCategory method
ErrorType: EA.EnumMVErrorType - depending on the severity of the error being validated, can be:
mvErrorCritical
mvError
mvWarning, or
mvInformation
 
ErrorMessage: String - can contain a default error string, although this is probably overridden by the PublishResult call

 

EA_OnInitializeUserRules

Model Validation Example

DefineRuleCategory

PublishResult

DefineRuleCategory (
string CategoryName)

String

Defines a category of rules that can be performed during model validation (there is typically one category per Add-In). It must be called once from the EA_OnInitializeUserRules broadcast handler.

The return value is a CategoryId that must to be passed to the DefineRule method.

See the Model Validation Example for a detailed example of the use of this method.

Parameters:

CategoryName: String - a text string that is visible in the Model Validation Configuration dialog
 

EA_OnInitializeUserRules

DefineRule

Model Validation Example

DeleteBaseline (string BaselineGUID)

Boolean

Deletes a Baseline, identified by the BaselineGUID, from the repository.

Parameters:

BaselineGUID: String - the GUID (in XML format) of the Baseline to delete
 

 

DoBaselineCompare (
string PackageGUID,
string Baseline,
string ConnectString)

String

Performs a Baseline comparison using the supplied package GUID and Baseline GUID (obtained in the result list from GetBaselines).

Optionally you can include the connection string required to find the Baseline if it exists in a different model file.

This method returns a log file of the status of all elements found and compared in the difference procedure. You can use this log information as input to DoBaselineMerge - automatically merging information from the Baseline.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to run the comparison on
Baseline: String - the GUID (in XML format) of the Baseline to run the comparison on
ConnectString: String - the location of the external .EAP file or DBMS to extract the Baseline from
 

GetBaselines

DoBaselineMerge

DoBaselineMerge (
string PackageGUID,
string Baseline,
string MergeInstructions,
string ConnectString)

String

Performs a batch merge based on instructions contained in an XML file (MergeInstructions). You can supply an optional connection string if the Baseline is located in another model.

In the MergeInstructions file, each MergeItem node supplies the GUID of a differenced item from the XML difference log. As the merge is uni-directional and actioned in only one possible way, no additional arguments are required. Enterprise Architect chooses the correct procedure based on the Difference results.

 

<Merge>

 <MergeItem guid="{XXXXXX}" />

 <MergeItem guid="{XXXXXX}" />

</Merge>

 

Alternatively, you can supply a single Mergeitem with a GUID of RestoreAll. In this case, Enterprise Architect batch-processes ALL differences.

 

<Merge>

 <MergeItem guid="RestoreAll" changed="true" baselineOnly="true" modelOnly="true" moved="true" fullRestore="false" />

</Merge>

 

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to merge the Baseline into
Baseline: String - the GUID of the Baseline (in XML format) to merge into the package
MergeInstructions: String - the file containing the GUID of each differenced item from the XML difference log returned by DoBaselineCompare()
ConnectString: String  - the location of the EAP file or DBMS to get the Baseline from, if not in the same model as the package
 

DoBaselineCompare()

EnumDiagramElements (
string DiagramGUID)

protected abstract: String

Gets an XML list of all elements in a diagram.

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to get elements for
 

 

EnumDiagrams (
string PackageGUID)

protected abstract: String

Gets an XML list of all diagrams in a specified package.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to list diagrams for
 

 

EnumElements (
string PackageGUID)

protected abstract: String

Gets an XML list of elements in a specified package.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to get a list of elements for
 

 

EnumLinks (
string ElementGUID)

protected abstract: String

Gets an XML list of connectors for a specified element.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element to get all associated connectors for
 

 

EnumPackages (
string PackageGUID)

protected abstract: String

Gets an XML list of child packages inside a parent package.

Parameters:

PackageGUID: String - the GUID (in XML format) of the parent package
 

 

EnumProjects ()

protected abstract: String

Gets a list of projects in the current file; corresponds to Models in Repository.
 

Models

EnumViews ()

protected abstract: String

Enumerates the Views for a project. Returned as an XML document.

 

 

EnumViewEx (
string ProjectGUID)

protected abstract: String

Gets a list of Views in the current project.

Parameters:

ProjectGUID: String - the GUID (in XML format) of the project to get views for

 

 

Exit ()

protected abstract: String

Exits the current instance of Enterprise Architect; this function is maintained for backward compatibility and should never be called.

Enterprise Architect automatically exits when you are no longer using any of the provided objects.

 

 

ExportPackageXMI (
string PackageGUID,
enumXMIType XMIType,
long DiagramXML,
long DiagramImage,
long FormatXML,
long UseDTD,
string FileName)

protected abstract: String

Exports XMI for a specified package.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to be exported
XMIType: EnumXMIType - specifies the XMI type and version information; see XMIType Enum for accepted values
DiagramXML: Long - true if XML for diagrams is required; accepted values:
 
0 = Do not export diagrams
1 = Export diagrams
2 = Export diagrams along with alternate images
 
DiagramImage: Long - the format for diagram images to be created at the same time; accepted values:
 
-1=NONE
0=EMF
1=BMP
2=GIF
3=PNG
4=JPG
 
FormatXML: Long - true if XML output should be formatted prior to saving
UseDTD: Long - true if a DTD should be used
FileName: String - the filename to output to

 

XMIType Enum

ExportPackageXMIEx (
string PackageGUID,
enumXMIType XMIType,
long DiagramXML,
long DiagramImage,
long FormatXML,
long UseDTD,
string FileName,
ea.ExportPackageXMIFlag Flags)

protected abstract: String

Exports XMI for a specified package, with a flag to determine whether the export includes package content below the first level.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to be exported
XMIType: EnumXMIType - specifies the XMI type and version information; see XMIType Enum for accepted values
DiagramXML: Long - true if XML for diagrams is required; accepted values:
 
0 = Do not export diagrams
1 = Export diagrams
2 = Export diagrams along with alternate images
 
DiagramImage: Long - the format for diagram images to be created at the same time; accepted values:
 
-1=NONE
0=EMF
1=BMP
2=GIF
3=PNG
4=JPG
 
FormatXML: Long - true if XML output should be formatted prior to saving
UseDTD: Long - true if a DTD should be used.
FileName: String - the filename to output to
Flags: ea.ExportPackageXMIFlag - whether or not to include package content below the first level (currently only supported for xmiEADefault)

 

Package Content

XMIType Enum

ExportPackageXMIFlag

GenerateClass (
string ElementGUID,
string ExtraOptions)

Boolean

Generates the code for a single Class.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element to generate
ExtraOptions: String - enables extra options to be given to the command; currently unused

 

 

GenerateDiagramFromScenario (
string ElementGUID,
EnumScenarioDiagramType DiagramType,
long OverwriteExistingDiagram)

Boolean

Generates various diagrams from the Structured Specification of an element.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element containing the Structured Specification
DiagramType: EnumScenarioDiagramType - the type of diagram to generate; see ScenarioDiagramType Enum for accepted values
OverwriteExistingDiagram: Long - determines whether to  overwrite the existing diagram or synchronize the existing elements with the scenario steps
 
0 = Delete the existing diagram and elements, and create a new diagram and elements
1 = Synchronize existing elements with the scenario steps and preserve the diagram layout
2 = Synchronize existing elements with the scenario steps and re-cast the diagram layout
3 = Do not generate a diagram if one already exists

 

ScenarioDiagramType Enum

GenerateElementDDL (
string ElementGUID,
string FileName,
string ExtraOptions)

Boolean

Generates DDL for an element.

For example:

 

owner=true;pkfkconstraints=true;commentlevel=3;

 

 

Parameters:

ElementGUID: String - the GUID (in XML format) of the element to generate DDL for
FileName: String - the target file path to which to write the generated DDL
ExtraOptions: String - enables extra options to be given to the command; currently enables:
Generate Owner (owner)
Generate PK/FK Key Constraints (pkfkconstraints)
Generate Comments:
 
0=None
1=Table
2=Column
3=All

 

 

GeneratePackage (
string PackageGUID,
string ExtraOptions)

Boolean

Generates the code for all Classes within a package.

For example:

 

recurse=1;overwrite=1;dir=C:\

 

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to generate code for
ExtraOptions: String - enables extra options to be given to the command; currently enables:
Generation of all subpackages (recurse)
Force overwrite of all files (overwrite) and
Specification to auto generate all paths (dir)

 

 

GeneratePackageDDL (
string PackageGUID,
string FileName,
string ExtraOptions)

Boolean

Generates DDL for a package.

For example:

 

owner=true;pkfkconstraints=true;commentlevel=3;

singlefile=true;includechild=true;

 

 

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to generate DDL for
FileName: String - the target file path to which to write the generated DDL
ExtraOptions: String - enables extra options to be given to the command; currently enables:
Generate DDL for child packages (includechild)
Generate Owner (owner)
Generate PK/FK Key Constraints (pkfkconstraints)
Generate Comments:
 
0 - None
1 - Table
2 - Column
3 - All
 
Generate in SingleFile (singlefile)

 

 

GenerateTestFromScenario (
string ElementGUID,
EnumScenarioTestType TestType)

Boolean

Generates either an Internal test or an External test from the Structured Specification of an element.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element containing the Structured Specification
TestType: EnumScenarioTestType - the type of test to generate; see ScenarioTestType Enum for accepted values

 

Generate Test Cases

ScenarioTestType Enum

GenerateWSDL(
string WSDLComponentGUID,
string Filename,
string Encoding,
string ExtraOptions)

Boolean

Generates WSDL for the specified WSDL stereotyped Component.

Parameters:

WSDLComponentGUID: String - the GUID (in XML format) of the WSDL stereotyped Component
Filename: String - the target file path
Encoding: String - the XML encoding for the code page instruction
ExtraOptions: String - enables extra options to be given to the command; currently unused
 

Web Services - WSDL

GenerateXSD (
string PackageGUID,
string FileName,
string Encoding,
string Options)

Boolean

Creates an XML schema for a package, specified by its GUID. Returns true on success.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package
FileName: String - the target filepath
Encoding: String - the XML encoding for the code page instruction
Options: String - enables extra options to be given to the command; currently enables:
GenGlobalElement - turn the generation of global elements for all global ComplexTypes On or Off; for example: - GenGlobalElement=1

 

 

GetBaselines (
string PackageGUID,
string ConnectString)

String

Returns a list (in XML format) of Baselines associated with the supplied package GUID. Optionally, you can provide a connection string to get Baselines from the same package, but located in a different model file (or DBMS).

Parameters:

PackageGUID: String - the  GUID (in XML format) of the package to get Baselines for
ConnectString: String - the location of the EAP file or DBMS to get the Baselines from, if not in the same model as the package

 

 

GetDiagram (
string DiagramGUID)

protected abstract: String

Gets the diagram details, in XML format.

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to get details for
 

 

GetElement (
string ElementGUID)

protected abstract: String

Gets XML for the specified element.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element to retrieve XML for
 

 

GetElementConstraints (
string ElementGUID)

protected abstract: String

Gets constraints for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementEffort (
string ElementGUID)

protected abstract: String

Gets efforts for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementFiles (
string ElementGUID)

protected abstract: String

Gets metrics for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementMetrics (
string ElementGUID)

protected abstract: String

Gets files for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementProblems (
string ElementGUID)

protected abstract: String

Gets a list of issues (problems) associated with an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementProperties (
string ElementGUID)

protected abstract: String

Gets Tagged values for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementRequirements (
string ElementGUID)

protected abstract: String

Gets a list of requirements for an element, in XML format.

Parameters:

ElementGUID: String -the GUID (in XML format) of the element
 

 

GetElementResources (
string ElementGUID)

protected abstract: String

Gets a list of resources for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementRisks (
string ElementGUID)

protected abstract: String

Gets a list of risks associated with an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementScenarios (
string ElementGUID)

protected abstract: String

Gets a list of scenarios for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetElementTests (
string ElementGUID)

protected abstract: String

Gets a list of tests for an element, in XML format.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element
 

 

GetFileNameDialog (
string Filename,
string FilterString,
long FilterIndex,
long Flags,
string InitialDirectory,
long OpenOrSave)

 

String

Opens a standard File Open or Save As dialog and returns a string containing the full path to selected file on success.  Returns an empty string if dialog was canceled.

For example:

Filename = ""
FilterString = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*||"
Filterindex = 1
Flags = &H2 'OFN_OVERWRITEPROMPT
InitialDirectory = ""
OpenOrSave = 1
filepath = Project.GetFileNameDialog (Filename, FilterString, Filterindex, Flags, InitialDirectory, OpenOrSave)

 

In this example, the Save As dialog will prompt for a CSV file.

Parameters:

Filename: String - default filename specified in the dialog
FilterString: String - delimited list of available file type filters
Filterindex: Long - One-based index of the filter to be used by default
Flags: Long - additional bit flags used to initialize the file dialog.  See OPENFILENAME structure in MSDN documentation for accepted values.
InitialDirectory: String - directory path to open this dialog
OpenOrSave: Long - Show dialog as an "Open" or "Save As" style dialog. Accepted values: 0 = Open, 1 = Save As

 

 

GetLastError ()

protected abstract: String

Returns a string value describing the most recent error that occurred in relation to this object.

 

 

GetLink (
string LinkGUID)

protected abstract: String

Gets connector details, in XML format.

Parameters:

LinkGUID: String - the GUID (in XML format) of the connector to get details of
 

 

GUIDtoXML (
string GUID)

String

Changes an internal GUID to the form used in XML.

Parameters:

GUID: String - the Enterprise Architect style GUID to convert to XML format
 

 

ImportDirectory (
string PackageGUID,
string Language,
string DirectoryPath,
string ExtraOptions)

Boolean

Imports a source code directory into the model.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to reverse engineer code into
Language: String - specifies the language of the code to be imported
DirectoryPath: String - specifies the path where the code is found on the computer
ExtraOptions: String - enables extra options to be given to the command; currently enables import of source from all child directories (recurse) - for example: recurse=1

 

 

ImportFile (
string PackageGUID,
string Language,
string FileName,
string ExtraOptions)

Boolean

Imports an individual file or binary module into the model, in a package per namespace style import.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to reverse engineer code into; this is expected to be a namespace root package.
Language: String - specifies the language of the code to be imported

 

Use the value "DNPE" to import a binary module; this imports a .Net assembly or Java .class file, but not a .jar file.

Filename: String - specifies the path where the code or module is found on the computer
ExtraOptions: String - enables extra options to be given to the command; currently unused

 

 

ImportPackageXMI (
string PackageGUID,
string Filename,
long ImportDiagrams,
long StripGUID)

String

Imports an XMI file at a point in the tree.

Parameters:

PackageGUID: String - the GUID (in XML format) of the target package to import the XMI file into (or overwrite with the XMI file)
Filename or XMLText: String - the name of the XMI file

 

If the String is of type filename it is interpreted as a source file, otherwise the String is imported as XML text.

ImportDiagrams: Long
StripGUID: Long - boolean value to indicate whether to replace the element UniqueIDs on import; if stripped, then a package could be imported twice into Enterprise Architect, as two different versions

 

 

LayoutDiagram (
string DiagramGUID,
long LayoutStyle)

Boolean

Deprecated. it is recommended that LayoutDiagramEx is used instead.

Calls the function to automatically layout a diagram in hierarchical fashion. It is only recommended for Class and Object diagrams.

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to lay out
LayoutStyle: Long - always ignored
 

 

LayoutDiagramEx (
string DiagramGUID,
long LayoutStyle,
long Iterations,
long LayerSpacing,
long ColumnSpacing,
boolean SaveToDiagram)

Boolean

Calls the function to automatically layout a diagram in hierarchical fashion. It is only recommended for Class and Object diagrams.

LayoutStyle accepts the following options

Default Options:

lsDiagramDefault

lsProgramDefault
 

Cycle Removal Options:

lsCycleRemoveGreedy

lsCycleRemoveDFS
 

Layering Options:

lsLayeringLongestPathSink

lsLayeringLongestPathSource

lsLayeringOptimalLinkLength
 

Initialize Options:

IsInitializeNaive

IsInitializeDFSOut

IsInitializeDFSIn
 

Crossing Reduction Option:

lsCrossReduceAggressive
 

Layout Options - Direction

lsLayoutDirectionUp

lsLayoutDirectionDown

lsLayoutDirectionLeft

lsLayoutDirectionRight
 

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to lay out
LayoutStyle: Long - the layout style
Iterations: Long - the number of layout iterations the Layout process should take to perform cross reduction (Default value = 4)
LayerSpacing: Long - the per-element layer spacing the Layout process shall use (Default value = 20)
ColumnSpacing: Long - the per-element column spacing the Layout process shall use (Default value = 20)
SaveToDiagram: Boolean - specifies whether or not Enterprise Architect should save the supplied layout options as default to the diagram in question

 

ConstLayoutStyles Enum

LoadControlledPackage (
string PackageGUID)

String

Loads a package that has been marked and configured as controlled. The filename details are stored in the package control data.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to load

 

 

LoadDiagram (
string DiagramGUID)

protected abstract: Boolean

Loads a diagram by its GUID.

Parameter:

DiagramGUID: String - the GUID (in XML format) of the diagram to load; if you retrieve the GUID using the Diagram interface, use the GUIDtoXML function to convert it to XML format

 

GUIDtoXML

LoadProject (
string FileName)

protected abstract: Boolean

Loads an Enterprise Architect project file.

Do not use this method if you have accessed the Project interface from the Repository, which has already loaded a file.

Parameters:

FileName: String - the name of the project file to load

 

 

Migrate (
string GUID,
string SourceType,
string DestinationType)

Void

Migrates a model (or part of a model) from one BPMN or SysML format to an upgraded format.

Parameters:

GUID: String - the GUID of the package or element for which the contents are to be migrated
SourceType: String - the type of model to be upgraded; accepted values:
 
BPMN
BPMN1.1
SysML1.1
SysML1.2
 
DestinationType: String - the type of model to upgrade to; accepted values:
 
BPMN1.1
BPMN1.1::BPEL
BPMN2.0
SysML1.2
SysML1.3

 

 

MigrateToBPMN11 (
string GUID,
string Type)

Void

Migrates every BPMN 1.0 construct in a package or an element (including elements, attributes, diagrams and connectors) to BPMN 1.1.

Parameters

GUID: String - the GUID of the package or element for which the contents are to be migrated to BPMN 1.1
Type: String - the type of upgrade, either just to BPMN 1.1 or  to BPMN 1.1 and BPEL. Accepted values are:
 
BPMN = migrate to BPMN 1.1
BPEL =  migrate to BPMN 1.1 and update:
any diagram with stereotype BPMN to BPEL
any element with stereotype BusinessProcess to BPELProcess

 

Migrating to BPEL is possible only in the Ultimate or Business and Software Engineering editions of Enterprise Architect.

 

 

ProjectTransfer (
string SourceFilePath,
string TargetFilePath,
string LogFilePath)

Boolean

Transfers the project from a .EAP file or DBMS to a .EAP file.

Parameters:

SourceFilePath: String - the path of the source file to transfer
TargetFilePath: String - the path of the target file; Enterprise Architect creates a new Base project in this location
LogFilePath: String - the path of the log file where the status of the transfer process is updated
 

In automation, the target file does not have to exist; the file path is enough. Enterprise Architect creates a new, empty Base.EAP file and transfers the source project into it.

 

 

PublishResult (
string CategoryID,
EA.EnumMVErrorType ErrorType,
string ErrorMessage)

String

Returns the results of each rule that can be performed during model validation. It must be called once for each rule from the EA_OnInitializeUserRules broadcast handler.

The return value is a RuleId, which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation.

See the Model Validation Example for a detailed example of the use of this method.

Parameters:

CategoryId: String - should be passed the return value from the DefineRuleCategory method
ErrorType: EA.EnumMVErrorType - depending on the severity of the error being validated, can be:
 
mvErrorCritical
mvError
mvWarning, or
mvInformation
 
ErrorMessage: String - contains an error string

 

EA_OnInitializeUserRules

Model Validation Example

DefineRuleCategory

PutDiagramImageOnClipboard (
string DiagramGUID,
long Type)

protected abstract: Boolean

Copies an image of the specified diagram to the clipboard.

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to copy
Type: Long - the file type
If Type = 0 then it is a metafile
If Type = 1 then it is a Device Independent Bitmap

 

 

PutDiagramImageToFile (
string Diagram GUID,
string FileName,
long Type)

protected abstract: Boolean

Saves an image of the specified diagram to file.

Parameters:

DiagramGUID: String - the GUID (in XML format) of the diagram to save
FileName: String - the name of the file to save the diagram into
Type: Long - the file type
If type = 0 then it is a metafile
If type = 1 then it uses the file type from the name extension (that is, .bmp, .jpg, .gif, .png, .tga)

 

 

ReloadProject ()

protected abstract: Boolean

Reloads the current project.

This is a convenient method to refresh the current loaded project (in case of outside changes to the .EAP file).

 

 

RunModelSearch (
string Search,
string SearchTerm,
bool ShowInEA)

Void

Invokes the Model Search component.

Parameters:

Search: String - the name of an Enterprise Architect defined search
SearchTerm: String - the term to search for in the project
ShowInEA: Boolean - execute the search and output in the Model Search window
 

Model Search

RunReport (
string PackageGUID,
string TemplateName,
string Filename)

protected abstract: Void

Runs a named RTF report.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to run the report on
TemplateName: String - the RTF report template to use; if the PackageGUID has a stereotype of MasterDocument, the template is not required
FileName: String - the file name and path to store the generated report.  The file extension specified will determine the format of the generated document.  E.g. RTF, PDF.

 

Generate Documentation

 

RunHTMLReport (
string PackageGUID,
string ExportPath,
string ImageFormat,
string Style,
string Extension)

String

Runs an HTML report (as for Documentation | HTML Documentation when you right-click on a package in the Project Browser).

Parameters:

PackageGUID: String - the GUID (in XML format) of the package to run the report on
ExportPath: String - the directory path to store the generated report files
ImageFormat: String - file format in which to store images - .PNG or .GIF
Style: String - name of the web style template to apply. Use <default> for the standard, system-provided template
Extension: String - file extension for generated HTML files (Example: .htm)

 

Create an HTML Report

 

SaveControlledPackage (
string PackageGUID)

String

Saves a package that has been configured as a controlled package, to XMI. Only the package GUID is required, Enterprise Architect picks the rest up from the package control information.

Parameter:

PackageGUID: String - the GUID (in XML format) of the package to save

 

 

SaveDiagramImageToFile (
string Filename)

protected abstract: String

Saves a diagram image of the current diagram to file.

Parameters:

FileName: String - the filename of the image to save

 

 

ShowWindow (
long Show)

protected abstract: Void

Shows or hides the Enterprise Architect User Interface.

Parameters:

Show: Long

 

 

SynchronizeClass (
string ElementGUID,
string ExtraOptions)

Boolean

Synchronizes a Class with the latest source code.

Parameters:

ElementGUID: String - the GUID (in XML format) of the element to update from code
ExtraOptions: String - enables extra options to be given to the command; currently unused

 

 

SynchronizePackage (
string PackageGUID,
string ExtraOptions)

Boolean

Synchronizes each Class in a package with the latest source code.

Parameters:

PackageGUID: String - the GUID (in XML format) of the package containing the elements to update from code
ExtraOptions: String - enables extra options to be given to the command; currently enables synchronization of all child packages (children) - for example: children=1

 

 

TransformElement (
string TransformName,
string ElementGUID,
string TargetPackage,
string ExtraOptions)

Boolean

Transforms an element into a package.

Parameters:

TransformName: String - specifies the transformation that should be executed
ElementGUID: String - the GUID (in XML format) of the element to transform
TargetPackageGUID: String - the GUID (in XML format) of the package to transform into
ExtraOptions: String - enables extra options to be given to the command:
GenCode=True/False - articulate code generation from the transformed elements; this option supercedes the current model setting

 

 

TransformPackage (
string TransformName,
string SourcePackage,
string TargetPackage,
string ExtraOptions)

Boolean

Runs a transformation on the contents of a package.

Parameters:

TransformName: String - specifies the transformation that should be executed
SourcePackageGUID: String - the GUID (in XML format) of the package to transform
TargetPackageGUID: String - the GUID (in XML format) of the package to transform into
ExtraOptions: String - enables extra options to be given to the command:
GenCode=true/false - articulate code generation from the transformed elements; this option supercedes the current model setting
SubPackages=true/false - specify if the child packages are to be included whilst transforming a package

 

 

ValidateDiagram (
string DiagramGUID)

Boolean

Invokes the Enterprise Architect Model Validation component, then validates the diagram (for correctness) and the elements and connectors within the diagram.

Output can be viewed through View | System Output > Model Validation.

Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation.

Parameters:

DiagramGUID: String - the GUID of the Diagram Class object
 

 

 

 

 

 

 

 

 

 

 

 

 

Model Validation

ValidateElement (
string ElementGUID)

Boolean

Invokes the Enterprise Architect Model Validation component, then validates the element and all child elements, diagrams, connectors, attributes and operations.

Output can be viewed through View | System Output > Model Validation.

Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation.

Parameters:

ElementGUID: String - the GUID of the Element Class object
 

ValidatePackage (
string PackageGUID)

Boolean

Invokes the Enterprise Architect Model Validation component, then validates the package and all sub-packages, elements, connectors and diagrams within it.

Output can be viewed through View | System Output > Model Validation.

Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation.

Parameters:

PackageGUID: String - the GUID of the Package Class object
 

XMLtoGUID (
string GUID)

String

Changes a GUID in XML format to the form used inside Enterprise Architect.

Parameters:

GUID: String - the XML style GUID to convert to Enterprise Architect internal format

 

 

Notes

These methods all require input GUIDs in XML format; use GUIDtoXML to change the Enterprise Architect GUID to an XML GUID

Learn more