Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Nx Journal bug in API??? componentpattern ==> getAllPatternMembers

  • Thread starter Thread starter FV
  • Start date Start date
Status
Not open for further replies.

FV

Mechanical
Joined
Jul 14, 2011
Messages
6
Location
BE
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

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top