MANox
Mechanical
- Apr 2, 2007
- 130
Hello,
I have problem with check which components are suppressed in active arrangement in assembly.
I try with this, but without positive results:
Maybe someone could find fault in my code or show me right way to success.
Best regards
MANok
NX2027
TC14
I have problem with check which components are suppressed in active arrangement in assembly.
I try with this, but without positive results:
Code:
Imports NXOpen.UF
Imports NXOpen.Assemblies
Imports NXOpen.Assemblies.Component
Module Arrangement_tester
Dim arrtheSession As Session = Session.GetSession()
Dim workPart As Part = arrtheSession.Parts.Work
Dim displayPart As Part = arrtheSession.Parts.Display
Dim startWorkPart As Part = arrtheSession.Parts.Work
Dim startDispPart As Part = arrtheSession.Parts.Display
Public ufs As UFSession = UFSession.GetUFSession()
Public lw As ListingWindow = arrtheSession.ListingWindow
Sub Main()
Dim startWorkPart As Part = arrtheSession.Parts.Work
Dim startDispPart As Part = arrtheSession.Parts.Display
lw.Open()
Try
Dim c As ComponentAssembly = displayPart.ComponentAssembly
Dim activeArr As Arrangement
activeArr = c.ActiveArrangement
For Each child As Component In c.RootComponent.GetChildren()
Dim IsSuppresed As Boolean
c.GetSuppressedState(child, activeArr, IsSuppresed)
If Not IsSuppresed Then
lw.WriteLine(child.DisplayName & " is suppresed")
End If
Next
Catch e As Exception
arrtheSession.ListingWindow.WriteLine("Failed: " & e.ToString)
End Try
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function
End Module
Maybe someone could find fault in my code or show me right way to success.
Best regards
MANok
NX2027
TC14