DocumentGenerator Class

The DocumentGenerator Class can be accessed from the Repository using CreateProjectGenerator(). 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.

DocumentGenerator Attributes:

Attribute

Type

Notes

ObjectType

ObjectType

Read only. Distinguishes objects referenced through a Dispatch interface.

Document Generator Methods:

Method

Type

Notes

DocumentDiagram (long DiagramID, long nDepth, string templateName)

Boolean

Documents a diagram.

Parameters:

  • DiagramId: Long - the ID of the diagram.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting diagrams; can be blank.

DocumentElement (long ElementID, long nDepth, string templateName)

Boolean

Documents an element.

Parameters:

  • ElementId: Long - the ID of the element.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting elements; can be blank.

DocumentModelAuthor (string name, long nDepth, string templateName)

Boolean

Documents a model author.

Parameters:

  • Name: String - the name of the author.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting model authors; can be blank.

DocumentModelClient (string name, long nDepth, string templateName)

Boolean

Documents a single model client.

Parameters:

  • Name: String - the name of the client.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String -  a template to use when documenting model clients; can be blank.

DocumentModelGlossary (long id, long nDepth, string templateName)

Boolean

Documents a single model glossary term.

Parameters:

  • id: Long - the ID of the term.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String -  a template to use when documenting model glossary terms; can be blank.

DocumentModelIssue (long id, long nDepth, string templateName)

Boolean

Documents a single model issue.

Parameters:

  • id: Long - the ID of the issue.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting model issues; can be blank.

DocumentModelResource (string name, long nDepth, string templateName)

Boolean

Documents a single model resource.

Parameters:

  • Name: String - the name of the resource.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String -  a template to use when documenting model resources; can be blank.

DocumentModelRole (string name, long nDepth, string templateName)

Boolean

Documents a single model role.

Parameters:

  • Name: String - the name of the role.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting model roles; can be blank.

DocumentModelTask (long id, long nDepth, string templateName)

Boolean

Documents a single model task.

Parameters:

  • id: Long - the ID of the the task.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String -  a template to use when documenting model tasks; can be blank.

DocumentPackage (long PackageID, long nDepth, string templateName)

Boolean

Documents a package.

Parameters:

  • PackageId: Long - the ID of the package.
  • nDepth: Long - adjust the heading level by nDepth.
  • templateName: String - a template to use when documenting packages; can be blank.

GetLastError()

String

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

InsertBreak (enum breakType)

Boolean

Inserts a break into the report at the current location.

Parameters:

  • breakType: enum - 0 = page break, 1 = section break.

InsertLinkedDocument (string guid)

Boolean

Inserts a linked document into the report at the current location.

A linked document can used to set the header and footer of the report. These are taken from the first linked document added to the report.

Parameters:

  • guid: String - the GUID of the element that has a linked document.

InsertTableOfContents

Boolean

Inserts a Table of Contents at the current position.

InsertTeamReviewPost (string path)

Boolean

Inserts a Team Review posting into the report at the current location.

Parameters:

  • path: String - the path of the Team Review post.

InsertText (string Text, string styple

Boolean

Inserts some static text into the report at the current location.

No carriage return is added, so remember to add one if required.

Parameters:

  • Text: String - the static text to be inserted.
  • Stype: String - the name of the style in the template; defaults to Normal style.

NewDocument (string templateName)

Boolean

Starts a new document; must be called before attempting to document anything else.

Parameters:

  • templateName: String - a template to use when documenting elements.  Can be blank.

ReplaceField (string fieldname, string fieldvalue)

Boolean

Updates the fieldname with the value given.

If you call this function more than once with the same fieldname, the field only has the last value set.

Parameters:

  • fieldname: String - the fieldname to find.
  • fieldvalue: String - the value to insert into the field.

SaveDocument (string filename, enum nDocType)

Boolean

Saves the document to disk.

Parameters:

  • filename: String - the filename to save the file to.
  • nDocType: Enum - 0 = RTF, 1 = HTML.