Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SDETERS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

select only unsuppress parts in sub-assemblies

Status
Not open for further replies.

MANox

Mechanical
Apr 2, 2007
130
Hello everyone,

I have code for select all unsuppres part in assembly:

Code:
  Sub getAllComponents2(ByVal comp As NXOpen.Assemblies.Component, ByRef allComp As List(Of compDescr))
        Dim c As ComponentAssembly = CType(comp.Prototype, Part).ComponentAssembly
        Dim activeArr As Arrangement = c.ActiveArrangement
        For Each child As NXOpen.Assemblies.Component In comp.GetChildren()
            Dim IsSuppresed As Boolean
            Dim theSuppressedState As ComponentAssembly.SuppressedState
            theSuppressedState = c.GetSuppressedState(child, activeArr, IsSuppresed)
            If theSuppressedState = 2 Then
                Dim cDescr As compDescr = Nothing
                If ReadAttribiute(child, cDescr) = True Then
                    allComp.Add(cDescr)
                    getAllComponents2(child, allComp)
                End If
            End If
        Next

The problem is: This code ask about active arrangement for PART, no for COMPONENT ASSEMBLY.
The same sub-assemblies in one assembly have different arrangement, and I have always that same value.

Trying with child.OwnigPart.ComponentAssembly work that same.
I must find method to change "comp" to "c" with information about instance of this component.
Dim c As ComponentAssembly = comp ????? ComponentAssembly
I think solution in near but my head is empty.

Maybe somebody can help.

Best regards

MANok
NX2027
TC14


 
Replies continue below

Recommended for you

Thanks cowski.

this is it.

Best regrards

MANok
NX2027
Tc14
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor