Showing results for 
Search instead for 
Do you mean 
Reply

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.?????????

 

 

1 REPLY

Re: Retrieve working part (Model Compare )

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

        theLw.Open()

        For Each bPart As BasePart In theSession.Parts
            theLw.WriteLine(bPart.FullPath)
        Next bPart 

    End Sub

End Module