Create Parts List

I couldn't record the Parts List button, but found something on GTAC coded for C# (search nx_api4978 on GTAC to find it).

I put together something in VB.NET that imitates the function of the Parts List button. Hopefully it helps saves someone the trouble I went through!

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI

Module NXJournal

Dim ufs As UFSession = UFSession.GetUFSession()

Sub Main()
CreatePartsList()
End Sub

Function CreatePartsList()
Dim origin As Double() = New Double(2) {0.0, 0.0, 0.0}

Dim partsListTag As Tag = NXOpen.Tag.Null

Dim partUnits As Integer = 0

Dim prefs As UFPlist.Prefs = Nothing

ufs.Plist.AskDefaultPrefs(prefs)

SelectPoint("Parts List Position", origin)

ufs.Plist.Create(prefs, origin, partsListTag)

End Function

Function SelectPoint(cue As String, ByRef base_pt As Double()) As Integer
Dim point_tag As NXOpen.Tag = NXOpen.Tag.Null

Dim response As Integer = 0

Dim base_method As UFUi.PointBaseMethod = UFUi.PointBaseMethod.PointInferred

ufs.Ui.LockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
ufs.Ui.PointConstruct(cue, base_method, point_tag, base_pt, response)
ufs.Ui.UnlockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)

Return response

End Function

End Module

Best,
Craptor

Is there anyway I can add additional columns and use other custom attributes.

Regards,

Joe