Showing results for 
Search instead for 
Did you mean: 

Re: Add PP-Event to Tool

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
            For Each theNCGroup As CAM.NCGroup In workPart.CAMSetup.CAMGroupCollection
                If TypeOf theNCGroup Is NXOpen.CAM.Tool Then
                    ExchangeCoolantUDE(CType(theNCGroup, CAM.Tool))
                End If
    Private Sub ExchangeCoolantUDE(theTool As CAM.Tool)
        Dim oParams(0)   As Cam.CAMObject
        Dim oStartUdeSet As CAM.ObjectsUdeSet = Nothing
        Dim oCoolUde     As CAM.Ude = Nothing
        Dim oObject      As NXObject = Nothing
        oParams(0) = theTool
        oStartUdeSet = workPart.CAMSetup.CreateObjectsUdeSet(oParams, Cam.CAMSetup.Ude.Start)
        For Each theUde As Cam.Ude In oStartUdeSet.UdeSet.UdeList.GetContents()
            If theUde.UdeName = "MyOldCoolant" Then
                    oStartUdeSet.UdeSet.UdeList.Erase(theUde, ObjectList.DeleteOption.Delete)
            End If
        oCoolUde = oStartUdeSet.UdeSet.CreateUdeByName("MyNewCoolant")

        oObject = oStartUdeSet.Commit()
        oStartUdeSet = Nothing
    End Sub

Hope this helps.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX12.0.2, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 ( | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX (1876) | AWC 3.4 Preparing: -

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Add PP-Event to Tool

Valued Contributor
Valued Contributor

Thank you Mr. Pendl for your Help :-)


Production: {NX MP09}
Testing: {NX 1872.0.0.1500 MP--}

Learn online

Solution Information