Count for All Referenced Documents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to get a count for all the Referenced Documents before it goes into the "For Each" loop?
For example:
Sub FileRefs()
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = oAsmDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence
Dim oRefDoc As Document
'MsgBox oRefDoc.Count
For Each oRefDoc In oAsmDoc.AllReferencedDocuments
MsgBox oRefDoc.DisplayName
Next
End Sub
I want to know how many times it is going to go through the For Each loop before I enter into it. See where the 'MsgBox oRefDoc.Count is? That is where I need to know. If I have an assembly with three parts the count should be zero. If I have a structure and I am interested in the Count for the 123.iam how would I do that in the following Structure:
Assy.iam
Part1.ipt
Part2.ipt
123.iam
Part3.ipt
Part4.ipt
Part5.ipt
So the count for 123.iam would be 3. One for the 123.iam, Part3.ipt, and Part4.ipt
Hopefully that makes sense.