Forums:
At the moment I have a function to open parts that are already loaded and one for parts that haven't been opened, yet. But now I need one that can handle both or at least some way to determine if a part is loaded or not. How do I do that?
Sub open(number) Dim part1 As NXOpen.Part = CType(theSession.Parts.FindObject("@DB/" + number), NXOpen.Part) Dim partLoadStatus1 As NXOpen.PartLoadStatus = Nothing theSession.Parts.SetActiveDisplay(part1, NXOpen.DisplayPartOption.AllowAdditional, NXOpen.PartDisplayPartWorkPartOption.UseLast, partLoadStatus1) workPart = theSession.Parts.Work displayPart = theSession.Parts.Display partLoadStatus1.Dispose() End Sub