Project

Return to Introduction  Previous page  Next page

public 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

LoadProject (String)

protected abstract: Boolean

param: FileName [ String - in ]

Load 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.

ReloadProject ()

protected abstract: Boolean

Reload the current project. Convenient method to refresh the current loaded project (in case of outside changes to the .EAP file).

LoadDiagram (String)

protected abstract: Boolean

param: DiagramGUID [ String - in ]

Load a diagram by its GUID. Note that Enterprise Architect expects this GUID in XML format. If you retrieve the GUID using the Diagram interface, you must convert to XML format; use the GUIDtoXML and XMLtoGUID functions to do this.

SaveDiagramImageToFile (String)

protected abstract: String

param: FileName [ String - in ] The filename of the image to save.

Save a diagram image of the current diagram to file.

GetElement (String)

protected abstract: String

param: ElementGUID [ String - in ]

The GUID of the element to retrieve XML for. GUID must be in XML format (use GUIDtoXML to change an Enterprise Architect GUID to an XML GUID).

Get XML for the specified element.

EnumViews ()

protected abstract: String

Enumerate the views for a project. Returned as an XML document.

EnumPackages (String)

protected abstract: String

param: PackageGUID [ String - in ]

Get a list of packages inside another. Returned as XML. Supply the GUID of the parent package, in XML format.

EnumElements (String) 

protected abstract: String 

param: PackageGUID [ String - in ] GUID of package to get list of elements for. Must be in XML format.

List elements inside a package, in XML format.

EnumLinks (String)

protected abstract: String

param: PackageID [ String - in ]

The package to get all associated links for.

EnumDiagrams (String)

protected abstract: String

param: PackageGUID [ String - in ]

The GUID of the package to list diagrams for. Must be in XML format.

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

EnumDiagramElements (String)

protected abstract: String

param: DiagramGUID [ String - in ] The diagram GUID (in XML format) of the diagram to get elements for.

Get a list of all elements contained in a diagram, in XML format.

EnumDiagramLinks (String)

protected abstract: String

param: DiagramID [ String - in ]

The Diagram ID to get links for.

Get a list of links appearing in a diagram, in XML format.

GetLink (String)

protected abstract: String

param: LinkGUID [ String - in ]

The GUID to get details of, in XML format.

Get connector details, in XML format.

GetDiagram (String)

protected abstract: String

param: DiagramGUID [ String - in ]

The diagram ID, in XML format.

Get diagram details, in XML format.

GetElementConstraints (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get constraints  for an element, in XML format. Supply the element ID, in XML format.

GetElementEffort (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get effort for an element, in XML format.

GetElementMetrics (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get metrics  for an element., in XML format

GetElementFiles (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get files for an element, in XML format.

GetElementRequirements (String)

protected abstract: String

param: ElementGUID [ String - in ]

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

GetElementProblems (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get a list of Issues (problems) associated with an element.

GetElementResources (String)

protected abstract: String

param: ElementGUID [ String - in ]

Get a resource list for an element, in XML format.

GetElementRisks (String

protected abstract: String

param: ElementGUID [ String - in ]

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

GetElementScenarios (String

protected abstract: String

param: ElementGUID [ String - in ]

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

GetElementTests (String

protected abstract: String

param: ElementGUID [ String - in ]

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

ShowWindow (Long

protected abstract: void

param: Show [ Long - in ]

Show or Hide the Enterprise Architect User Interface.

Exit ()

protected abstract: void

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

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

PutDiagramImageOnClipboard (String, Long

protected abstract: Boolean

param: DiagramGUID [ String - in ]

param: Type [ Long - in ]

Place an image of the current diagram on the clipboard.

PutDiagramImageToFile (String, String, Long

protected abstract: Boolean

param: DiagramGUID [ String - in ]

param: Filename [ String - in ]

param: Type [ Long - in ] 

If type = 0 then it is metafile

If type = 1 then it uses the file type from the name extension (ie. .bmp, .jpg, .gif, .png, .tga)

Place an image of the current diagram to file.

ExportPackageXMI (String, XMIType, Long, Long, Long, Long, String)

protected abstract: String

param: PackageGUID [ String - in ]

The GUID of the package to be exported.

param: XMIType [ EnumXMIType - in ]

Specifies the XMI type and version information. See XMIType Enum for enableable values.

param: DiagramXML [ Long - in ]

True if XML for diagrams is required.

Accepted Values [ 0 = Do not export diagrams, 1 =  Export diagrams, 2 = Export diagrams along with alternate images ]

param: DiagramImage [ Long - in ]

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]

param: FormatXML [ Long - in ]

True if XML output should be formatted prior to saving.

param: UseDTD [ Long - in ]

True if a DTD should be used.

param: FileName [ String - in ]

The filename to output to.

Export XMI for a specified package.

EnumProjects () 

protected abstract: String

Get a list of projects in the current file; corresponds to Model in Repository.

EnumViewEx (String

protected abstract: String

param: ProjectGUID [ String - in ]

Get a list of Views in the current project.

RunReport (String, String, String)

protected abstract: void

param: PackageGUID [ String - in ]

param: TemplateName [ String - in ]

param: FileName [ String - in ]

Run a named report - RTF.

GetLastError () 

protected abstract: String

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

This function is rarely used since an exception is thrown when an error occurs.

GetElementProperties (String

protected abstract: String

param: ElementGUID [ String - in ]

Get Tagged Values for a specified element.

GUIDtoXML (String)

String

param: GUID [ String - in ]

The Enterprise Architect style GUID to convert to XML format.

Change an internal GUID to the form used in XML.

XMLtoGUID (String)

String

param: GUID [ String - in ]

The XML style GUID to convert to Enterprise Architect internal format.

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

RunHTMLReport (String, String, String, String, String)

String

param: PackageGUID [ String - in ]

param: ExportPath [ String - in ]

param: ImageFormat [ String - in ]

param: Style [ String - in ]

param: Extension [ String - in ]

Run a HTML report (same as Documentation | HTML Documentation on right-click of Package in the Project Browser window).

ImportPackageXMI (String, String, Long, Long)

String

param: PackageGUID [ String - in ]

PackageGUID is the filename to import into (or overwrite).

param: Filename or XMLText [ String - in ]

The name of the XMI file.

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

param: ImportDiagrams [ Long - in ]

param: StripGUID [ Long - in ]

Boolean value to indicate whether you want to replace the element UniqueIDs on import.  If stripped, then a package could be imported twice into Enterprise Architect, as two different versions.

Provides the ability to import an XMI file at a point in the tree.

SaveControlledPackage (String)

String

param: PackageGUID [ String - in ]

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 info. 

LoadControlledPackage (String)

String

param: PackageGUID [ String - in ]

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

LayoutDiagram (String, Long)

(Deprecated)

Boolean

param: DiagramGUID [ String - in ] 

param: LayoutStyle [ Long - in ]

This LayoutStyle parameter is always ignored; 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.

LayoutDiagramEx (String, Long, Long, Long, Long, Boolean)

Boolean

param: DiagramGUID [ String - in ]

param: LayoutStyle [ Long - in ]

param: Iterations [ Long - in ]

The number of layout iterations the Layout process should take to perform cross reduction (Default value = 4).

param: LayerSpacing [ Long - in ] 

The per-element layer spacing the Layout process shall use (Default value = 20).

param: ColumnSpacing [ Long - in ] 

The per-element column spacing the Layout process shall use (Default value = 20).

param: SaveToDiagram [ Boolean - in ] 

Specifies whether or not Enterprise Architect should save the supplied layout options as default to the diagram in question.

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 (also see Layout a Diagram and ConstLayoutStyles Enum): 

·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.

GenerateXSD(String, String, String, String)

Boolean

Create an XML schema for this GenerateXSD.  Returns True on success.

Parameters:

·PackageGUID: String, identifies the package
·Filename: String, target filepath
·Encoding: String, the XML encoding for the code page instruction
·Options: String, unused.

GenerateClass(String)

Boolean

Generates the code for a single class.

Parameters:

·ElementGUID: String, identifies the element to generate
·ExtraOptions: String, enables extra options to be given to the command; currently unused.

GeneratePackage(String, String)

Boolean

Generates the code for all classes within a package.

Parameters:

·PackageGUID: String, identifies the package to generate.
·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) - for example:recurse=1;overwrite=1;dir=C:\

TransformElement(String, String, String, String)

Boolean

Parameters:

·TransformName: String, specifies the transformation that should be executed
·ElementGUID: String, identifies the element to transform
·TargetPackageGUID: String, identifies the package to transform into
·ExtraOptions: String, enables extra options to be given to the command; currently unused.

TransformPackage(String, String, String, String)

Boolean

Runs a transformation on the contents of a package.

Parameters:

·TransformName: String, specifies the transformation that should be executed
·SourcePackageGUID: String, identifies the package to transform
·TargetPackageGUID: String, identifies the package to transform into
·ExtraOptions: String, enables extra options to be given to the command; currently unused.

SynchronizeClass(String, String)

Boolean

Synchronizes a class with latest source code.

Parameters:

·ElementGUID: String, identifies the element to update from code
·ExtraOptions: String, enables extra options to be given to the command; currently unused.

SynchronizePackage(String, String)

Boolean

Synchronizes each class in a package with latest source code.

Parameters:

·PackageGUID: String, identifies the package containing the elements to update from code
·ExtraOptions: String, enables extra options to be given to the command; currently enables synchronisation of all child package (children) - for example children=1;

ImportDirectory(String, String, String, String)

Boolean

Imports source code directory into the model.

Parameters:

·PackageGUID: String, identifies 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, String, String, String)

Boolean

Used to import an individual file into the model, in a package per namespace style import.

Parameters:

·PackageGUID: String, identifies 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
·Filename: String, specifies the path where the code is found on the computer
·ExtraOptions: String, enables extra options to be given to the command; currently unused.