Hi all,
I'm trying to write a journal that reports all components of all component patterns in the workpart.
The problem is that i don't understand why my code does not work in NX9.0.3.4 MP8 while the same code works fine in NX10.
In NX9 it crashes on "GetAllPatternMembers()"
I think it is a bug is the API, but need to know for sure.
And of course any suggestions for a workaround would be great.
Thanks in advance
Fred
I'm trying to write a journal that reports all components of all component patterns in the workpart.
The problem is that i don't understand why my code does not work in NX9.0.3.4 MP8 while the same code works fine in NX10.
In NX9 it crashes on "GetAllPatternMembers()"
I think it is a bug is the API, but need to know for sure.
And of course any suggestions for a workaround would be great.
Thanks in advance
Fred
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Assemblies
Imports NXOpen.GeometricUtilities
Module report_all_component_patterns_in_workpart
Sub Main(ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim lw As ListingWindow = theSession.ListingWindow
Dim allCompPatterns As ComponentPatternCollection = workPart.ComponentAssembly.ComponentPatterns
lw.Open()
Dim patMemb() As PatternMember
For Each compPattern1 As ComponentPattern In allCompPatterns
lw.writeline(compPattern1.JournalIdentifier)
lw.writeline(compPattern1.Tag)
patMemb = compPattern1.GetAllPatternMembers()
lw.writeline (patMemb.length)
Next
End Sub
End Module