Cancel
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
            Next
    
    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
        Next
        
        oCoolUde = oStartUdeSet.UdeSet.CreateUdeByName("MyNewCoolant")

        oStartUdeSet.UdeSet.UdeList.Append(oCoolUde)
        
        oObject = oStartUdeSet.Commit()
        oStartUdeSet.Destroy()
        oStartUdeSet = Nothing
    End Sub

Hope this helps.

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

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 10.0.3.5 MP18}
Testing: {NX 12.0.2.9 MP03}

Learn online





Solution Information