Adding suppressed parts to be included in rule

Adding suppressed parts to be included in rule

Anonymous
Not applicable
220 Views
0 Replies
Message 1 of 1

Adding suppressed parts to be included in rule

Anonymous
Not applicable

I have the following code that works fine on all non-suppressed parts/sub assemblies...what code do I use to INCLUDE any suppressed parts/sub assemblies?

 

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 9812 StartFragment: 314 EndFragment: 9780 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet

Sub Main() 
    Dim oAsmDoc As AssemblyDocument = ThisDoc.Document

    ' Get the project number from user
    ProjectNo = Job_Number
    
    ' Change Project iProperty in Main Assemblhy
    iProperties.Value("Project", "Project") = ProjectNo
    
    ' Call recursion function
    Call TraverseAssembly(oAsmDoc.ComponentDefinition.Occurrences, 1, ProjectNo)
    Call oAsmDoc.Update
End Sub 
Private Sub TraverseAssembly(Occurrences As ComponentOccurrences, _ 
Level As Integer, ProjectNo As String) 

Dim oOcc As ComponentOccurrence 
    For Each oOcc In Occurrences 

        'Change Project iProperty for all
        iProperties.Value(oOcc.Name, "Project", "Project") = ProjectNo
        
        ' Check to see if this occurrence represents a subassembly 
        ' and recursively call this function to traverse through it. 
        If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then
            Call TraverseAssembly(oOcc.SubOccurrences, Level + 1, ProjectNo) 
        End If 
    Next 
End Sub
0 Likes
221 Views
0 Replies
Replies (0)