Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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

Status
Not open for further replies.

FV

Mechanical
Jul 14, 2011
6
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
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top