Referenced files by the assembly

Referenced files by the assembly

martinhoos
Advocate Advocate
501 Views
2 Replies
Message 1 of 3

Referenced files by the assembly

martinhoos
Advocate
Advocate

Hello all,

i found a code that gives all referenced files by the assembly back. Even files by sub-assemblies.

 

'- - - - - - - - - - - - -Component Drawings - - - - - - - - - - - -'look at the files referenced by the assembly
	Dim oRefDoc As Document
	Dim fileName As String 
	' For Each oRefDoc In oRefDocs = oAsmDoc.AllReferencedDocuments
	For Each oRefDoc In oAsmDoc.AllReferencedDocuments
		oFileName = Left(oRefDoc.DisplayName, Len(oRefDoc.DisplayName) - 4)		
		
		
		For Each fileName In System.IO.Directory.GetFiles(oPath1, "*.idw",System.IO.SearchOption.AllDirectories)
			If fileName.EndsWith(oFileName + ".idw") = True Then
				Dim oDrawDoc As DrawingDocument
				oDrawDoc = ThisApplication.Documents.Open(fileName, True)
				On Error Resume Next

 

I like to have a modification, so that the code only gives referenced files from the assembly NOT from the sub-assemblies. Is that possible?

Need your help.

Thanks in advance

Regards from Germany...

Martin

0 Likes
Accepted solutions (1)
502 Views
2 Replies
Replies (2)
Message 2 of 3

LukeDavenport
Collaborator
Collaborator
Accepted solution

Use ReferencedDocuments instead of AllReferencedDocuments.

 

Luke

Message 3 of 3

martinhoos
Advocate
Advocate

Hi Luke,

thank you very much for your reply. This works well!

Regards

Martin

0 Likes