Hide Table of Contents
GetDocumentDependencies2 Method (ISldWorks)

Gets all of the model dependencies for a document.

.NET Syntax

Visual Basic (Declaration) 
Function GetDocumentDependencies2( _
   ByVal Document As System.String, _
   ByVal Traverseflag As System.Boolean, _
   ByVal Searchflag As System.Boolean, _
   ByVal AddReadOnlyInfo As System.Boolean _
) As System.Object
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim Document As System.String
Dim Traverseflag As System.Boolean
Dim Searchflag As System.Boolean
Dim AddReadOnlyInfo As System.Boolean
Dim value As System.Object
value = instance.GetDocumentDependencies2(Document, Traverseflag, Searchflag, AddReadOnlyInfo)
System.object GetDocumentDependencies2( 
   System.string Document,
   System.bool Traverseflag,
   System.bool Searchflag,
   System.bool AddReadOnlyInfo
System.Object^ GetDocumentDependencies2( 
&   System.String^ Document,
&   System.bool Traverseflag,
&   System.bool Searchflag,
&   System.bool AddReadOnlyInfo



Name of the document


True if you want to traverse down into all dependent files, false if you want only the highest level within the dependencies


Set this argument to True if you want to use the search rules to find dependencies, false looks where the documents were last saved


True if you wish to have read-only information with the filenames; false if not

Return Value

Array of strings with two strings for each document returned in this list of dependent files:

  • File name

  • Filename with the complete pathname; this combination repeats itself for each dependent file found for this document



As an example, calling this method on a drawing document returns a list of all the part and assemblies used in the drawing. If you set the Traverseflag to True, then each of the parts within the assembly file are also returned in this array of strings.

Another example would be calling this method with a derived mirror part. Because a derived mirror part is generated from another part, the list of model dependencies returned by this method would include the original part used to generate the derived mirror part.

Be aware that Library features are completely unassociated. They do not require the library nor do they update when changes are made to the Library feature. Therefore, this method would not return Library features.

If you use this method with an assembly that contains two documents, Part1 and SubAssem1, an example of what might be returned is:

 [ "Part1", "C:\temp\Part1.SLDPRT", "SubAssem1", "c:\temp\SubAssem1.SLDASM" ]

If Traverseflag is set to True, then all of the documents contained in SubAssem1.ASM are also returned. Suppressed components are recognized and returned by this method as a dependent file.

If the AddReadOnlyInfo flag is set to True, then a string of "Read-Only" is added to the list of strings. If Part1 from were read-only, then the resulting set of strings would be:

 [ "Part1", "C:\temp\Part1.SLDPRT", "Read-Only", "SubAssem1", "c:\temp\SubAssem1.SLDASM", "" ]

NOTE: If the SearchFlag is set to True, then the current directory is set to the directory of the document file. This replicates the interactive behavior of the References button in the File Open dialog window.


See Also


SOLIDWORKS 2000 FCS, Revision Number 8.0

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   GetDocumentDependencies2 Method (ISldWorks)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2015 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.