Showing results for 
Search instead for 
Did you mean: 

Retrieve working part (Model Compare )


I am Working on NX 10 Model Compare Feature using NXOPEN (UF_MODL_model_compare).  I want to Retrieve working part and Other Part 2 in Model Compare feature.


I can retrieve  Working part (Part1)  by   Dim workPart As Part = theSession.Parts.Work   &  

I want to know how can retrieve other parts (Part 2) by using NXSession

Dim secondPart As Part =theSession.Parts.?????????




Re: Retrieve working part (Model Compare )

Siemens Phenom Siemens Phenom
Siemens Phenom

theSession.Parts() returns a PartCollection, not an individual part. You would need to iterate over the collection to find the part that you want, i.e.:


Option Strict Off

Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theLw As ListingWindow = theSession.ListingWindow


        For Each bPart As BasePart In theSession.Parts
        Next bPart 

    End Sub

End Module