Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 787

Create Parts List

$
0
0

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.UFImports NXOpen.UI 
Module NXJournal
 
    Dim ufs As UFSession = UFSession.GetUFSession() 
    Sub Main()
        CreatePartsList()EndSub 
    Function CreatePartsList()Dim origin AsDouble()=NewDouble(2){0.0, 0.0, 0.0} 
        Dim partsListTag As Tag = NXOpen.Tag.Null 
        Dim partUnits AsInteger=0 
        Dim prefs As UFPlist.Prefs=Nothing 
        ufs.Plist.AskDefaultPrefs(prefs) 
        SelectPoint("Parts List Position", origin) 
        ufs.Plist.Create(prefs, origin, partsListTag) 
    EndFunction 
    Function SelectPoint(cue AsString, ByRef base_pt AsDouble())AsIntegerDim point_tag As NXOpen.Tag= NXOpen.Tag.Null 
        Dim response AsInteger=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
 
    EndFunction 
EndModule

Best,
Craptor


Viewing all articles
Browse latest Browse all 787


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>