.NET Framework Class Library
Tree.GetAllDocumentsInStructureDB Method

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > .NET API > MwPDMApi Namespace > Tree Class > Tree Methods >

.NET Framework Class Library
Tree.GetAllDocumentsInStructureDB Method

Retrieves all documents within the tree structure of a specified main document, including assemblies, parts, drawings, and generic documents. This method performs a database-driven traversal using standard Mechworks PDM APIs and walks all document instances. It guarantees full structural accuracy and consistency with the database, including correct handling of multiple occurrences. Optional traversal of sub-projects and inclusion of drawings are controlled by the specified parameters. This method is recommended when data completeness and instance accuracy are required.

Namespace: MwPDMApi
Assembly:  MwPDMApi (in MwPDMApi.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

Visual Basic

Public Function GetAllDocumentsInStructureDB ( _

mainDocUid As String, _
addDrawings As Integer, _
traverseProjects As Boolean, _
Optional detectModelInDrawingsRegardlessPosition As Boolean = False _
) As TraverseProjectsAssemblies

C#

public TraverseProjectsAssemblies GetAllDocumentsInStructureDB(

string mainDocUid,
int addDrawings,
bool traverseProjects,
bool detectModelInDrawingsRegardlessPosition = false
)

Visual C++

public:

TraverseProjectsAssemblies^ GetAllDocumentsInStructureDB(
String^ mainDocUid,
int addDrawings,
bool traverseProjects,
bool detectModelInDrawingsRegardlessPosition = false
)

JavaScript

function getAllDocumentsInStructureDB(mainDocUid, addDrawings, traverseProjects, detectModelInDrawingsRegardlessPosition);

Parameters

mainDocUid

Type: System.String
The unique identifier of the main document to process.

addDrawings

Type: System.Int32
Determines whether to include drawings in the result: 0 = Do not include drawings, 1 = Include only linked drawings, 2 = Include all drawings.

traverseProjects

Type: System.Boolean
Specifies whether to traverse sub-projects: True = Traverse sub-projects, False = Do not traverse sub-projects.

detectModelInDrawingsRegardlessPosition (Optional)

Type: System.Boolean
Optional. Consider the case where a drawing is related to multiple models. If this parameter is set to True, when processing a document, the method adds the drawing to the drawing's output data collection, regardless wether the document's position is the first one in the drawing's related document list (ordered by increasing uid). Default is False, the drawing is added only if the document's position is the first one in the drawing's related document list.

Return Value

A TraverseProjectsAssemblies object containing the documents data obtaioned by traversing the tree structure.

Remarks

This method initializes a new instance of the TraverseProjectsAssemblies class to perform the traversal using database queries for enhanced efficiency.

See Also

Tree Class

Tree Members

MwPDMApi Namespace