Extracting a Repository Document

There are two ways to extract a repository document using scripting:

To extract any document:

Use the following

Description

ExtractToFile(ByVal FileName As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = -1, ByRef Actions As String = NULL, ByRef Conflicts As String = NULL) As BaseObject

Method on RepositoryModel that allows you to extract any kind of document

To extract a PowerDesigner document:

Use the following

Description

UpdateFromRepository(ByVal MergeMode As Integer = 2, ByRef actions As String = NULL, ByRef conflicts As String = NULL) As Boolean

Method on BaseModel that allows you to extract PowerDesigner documents

Generic Way

To extract a repository document you must:

  • Browse for a repository document using the ChildObjects collection

  • Extract the document using the method ExtractToFile (ByVal FileName As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = -1, ByRef Actions As String = NULL, ByRef Conflicts As String = NULL) As BaseObject

Example

set C = RepositoryConnection
C.Open
Dim D, P
set P = Nothing
for each D in C.ChildObjects
if D.IsKindOf (cls_RepositoryModel) then
D.ExtractToFile ("C:\temp\OO.OOM")
end if
next

Specific Way

To extract a RepositoryModel document or a RepositoryReport document you must:

  • Retrieve the document from the local model or multi-model report, (provided it has already been consolidated) using the method UpdateFromRepository (ByVal MergeMode As Integer = 2, ByRef actions As String = NULL, ByRef conflicts As String = NULL) As Boolean

Example

set MyModel = OpenModel ("C:\temp\OO3.OOM")
MyModel.UpdateFromRepository