Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Project
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.
Note: |
These methods all require input GUIDs in XML format; use GUIDtoXML to change the Enterprise Architect GUID to an XML GUID. |
Project Attributes
Attribute |
Type |
Notes |
ObjectType |
Read only. Distinguishes objects referenced through a Dispatch interface. |
Project Methods
Method |
Type |
Notes |
||
CreateBaseline (string PackageGUID, string Version, string Notes) |
Boolean |
Creates a Baseline of a specified package. Parameters:
|
||
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:
|
||
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 Model Validation Example for a detailed example of use of this method. Parameters:
|
||
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 Model Validation Example for a detailed example of use of this method. Parameters:
|
|||
DeleteBaseline (string BaselineGUID) |
Boolean |
Deletes a Baseline, identified by the BaselineGUID, from the repository. Parameters:
|
||
DoBaselineCompare |
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:
|
||
DoBaselineMerge |
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" /> </Merge> Parameters:
|
||
EnumDiagramElements (string DiagramGUID) |
protected abstract: String |
Gets an XML list of all elements in a diagram. Parameters:
|
||
EnumDiagrams (string PackageGUID) |
protected abstract: String |
Gets an XML list of all diagrams in a specified package. Parameters:
|
||
EnumElements (string PackageGUID) |
protected abstract: String |
Gets an XML list of elements in a specified package. Parameters:
|
||
EnumLinks (string ElementGUID) |
protected abstract: String |
Gets an XML list of connectors for a specified element. Parameters:
|
||
EnumPackages (string PackageGUID) |
protected abstract: String |
Gets an XML list of child packages inside a parent package. Parameters:
|
||
EnumProjects () |
protected abstract: String |
Gets a list of projects in the current file; corresponds to Models in Repository. |
||
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:
|
||
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:
|
||
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:
|
||
GenerateClass (string ElementGUID, string ExtraOptions) |
Boolean |
Generates the code for a single Class. Parameters:
|
||
GenerateDiagramFromScenario (string ElementGUID, EnumScenarioDiagramType DiagramType, long OverwriteExistingDiagram) |
Generates various diagrams from the Structured Specification of an element. Parameters:
|
|||
GeneratePackage (string Package GUID, string ExtraOptions) |
Boolean |
Generates the code for all Classes within a package. For example: recurse=1;overwrite=1;dir=C:\ Parameters:
|
||
GenerateTestFromScenario (string ElementGUID, EnumScenarioTestType TestType) |
Generates either an Internal test or an External test from the Structured Specification of an element. Parameters:
|
|||
GenerateXSD (string PackageGUID, string FileName, string Encoding, string Options) |
Boolean |
Creates an XML schema for this GenerateXSD. Returns true on success. Parameters:
|
||
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:
|
|||
GetDiagram (string DiagramGUID) |
protected abstract: String |
Gets diagram details, in XML format. Parameters:
|
||
GetElement (string ElementGUID) |
protected abstract: String |
Gets XML for the specified element. Parameters:
|
||
GetElementConstraints (string ElementGUID) |
protected abstract: String |
Gets constraints for an element, in XML format. Parameters:
|
||
GetElementEffort (string ElementGUID) |
protected abstract: String |
Gets efforts for an element, in XML format. Parameters:
|
||
GetElementFiles (string ElementGUID) |
protected abstract: String |
Gets metrics for an element, in XML format. Parameters:
|
||
GetElementMetrics (string ElementGUID) |
protected abstract: String |
Gets files for an element, in XML format. Parameters:
|
||
GetElementProblems (string ElementGUID) |
protected abstract: String |
Gets a list of issues (problems) associated with an element, in XML format. Parameters:
|
||
GetElementProperties (string ElementGUID) |
protected abstract: String |
Gets Tagged values for an element, in XML format. Parameters:
|
||
GetElementRequirements (string ElementGUID) |
protected abstract: String |
Gets a list of requirements for an element, in XML format. Parameters:
|
||
GetElementResources (string ElementGUID) |
protected abstract: String |
Gets a list of resources for an element, in XML format. Parameters:
|
||
GetElementRisks (string ElementGUID) |
protected abstract: String |
Gets a list of risks associated with an element, in XML format. Parameters:
|
||
GetElementScenarios (string ElementGUID) |
protected abstract: String |
Gets a list of scenarios for an element, in XML format. Parameters:
|
||
GetElementTests (string ElementGUID) |
protected abstract: String |
Gets a list of tests for an element, in XML format. Parameters:
|
||
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 as an exception is thrown when an error occurs. |
||
GetLink (string LinkGUID) |
protected abstract: String |
Gets connector details, in XML format. Parameters:
|
||
String |
Changes an internal GUID to the form used in XML. Parameters:
|
|||
ImportDirectory (string PackageGUID, string Language, string DirectoryPath, string ExtraOptions) |
Boolean |
Imports a source code directory into the model. Parameters:
|
||
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:
|
||
ImportPackageXMI (string PackageGUID, string Filename, long ImportDiagrams, long StripGUID) |
String |
Imports an XMI file at a point in the tree. Parameters:
|
||
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:
|
||
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 (also see ConstLayoutStyles Enum):
lsDiagramDefault lsProgramDefault.
lsCycleRemoveGreedy lsCycleRemoveDFS.
lsLayeringLongestPathSink lsLayeringLongestPathSource lsLayeringOptimalLinkLength.
IsInitializeNaive IsInitializeDFSOut IsInitializeDFSIn.
lsCrossReduceAggressive.
lsLayoutDirectionUp lsLayoutDirectionDown lsLayoutDirectionLeft lsLayoutDirectionRight. Parameters:
|
||
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:
|
||
LoadDiagram (string DiagramGUID) |
protected abstract: Boolean |
Loads a diagram by its GUID. Parameter:
|
||
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:
|
||
MigrateToBPMN11 (string GUID, string Type) |
Migrates every BPMN 1.0 construct in a package or an element (including elements, attributes, diagrams and connectors) to BPMN 1.1. Parameters
|
|||
PublishResult (string CategoryID, EA.EnumMVErrorType ErrorType, string ErrorMessage |
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 Model Validation Example for a detailed example of use of this method. Parameters:
|
|||
PutDiagramImageOnClipboard (string DiagramGUID, long Type) |
protected abstract: Boolean |
Copies an image of the specified diagram to the clipboard. Parameters:
|
||
PutDiagramImageToFile (string Diagram GUID, string FileName, long Type) |
protected abstract: Boolean |
Saves an image of the specified diagram to file. Parameters:
|
||
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). |
||
RunReport (string PackageGUID, string TemplateName, string Filename) |
protected abstract: Void |
Runs a named RTF report. Parameters:
|
||
RunHTMLReport (string PackageGUID, string ExportPath, string ImageFormat, string Style, string Extension) |
String |
Runs an HTML report (same as Documentation | HTML Documentation when you right-click on a package in the Project Browser). Parameters:
|
||
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:
|
||
SaveDiagramImageToFile (string Filename) |
protected abstract: String |
Saves a diagram image of the current diagram to file. Parameters:
|
||
ShowWindow (long Show) |
protected abstract: Void |
Shows or hides the Enterprise Architect User Interface. Parameters:
|
||
SynchronizeClass (string ElementGUID, string ExtraOptions) |
Boolean |
Synchronizes a Class with the latest source code. Parameters:
|
||
SynchronizePackage (string PackageGUID, string ExtraOptions) |
Boolean |
Synchronizes each Class in a package with the latest source code. Parameters:
|
||
TransformElement (string TransformName, string ElementGUID, string TargetPackage, string ExtraOptions) |
Boolean |
Transforms an element into a package. Parameters:
|
||
TransformPackage (string TransformName, string SourcePackage, string TargetPackage, string ExtraOptions) |
Boolean |
Runs a transformation on the contents of a package. Parameters:
|
||
XMLtoGUID (string GUID) |
String |
Changes a GUID in XML format to the form used inside Enterprise Architect. Parameters:
|