Showing results for 
Search instead for 
Do you mean 
Reply

Wrap tool path from planar mill operation

Hello,

I am trying to engrave some text on a cylindrical surface. I have seen some videos of people creating a planar mill operation and then wrapping it on a face. I like this option as you can select multiple boundaries as well as rough and finish. It seems like they may be using NXOPEN but I am having trouble finding how to use the out of the box NXOPEN routines. Not really sure if this can be done easily. The text I have to engrave is custom logos that require a zig/zag or follow periphery pattern to cut it away. GTAC helped me create some tool paths for this using the rotary operations however I think if I could figure out the NXOPEN application it would be worth while long term for engraving and other rotary milling functionality.

 

Attached is a generic example of something I need to engrave. 

 

Any feedback or help would be greatly appreciated.

 

 

NX11.0.1

3 REPLIES

Re: Wrap tool path from planar mill operation

[ Edited ]

Here goes a fully functional UDOP that reads through a CLS file (D:\temp) and generate a toolpath from 2D. Was converted into DOT.NET (VB). All it needs is the function to loop and array the CLSF entries and a deg2rad function (I think?).

 

If you or the others wants to help finishing it up we could have a nice wrapping UDOP function for cylindrical parts to share among the crop here.

 

Charles

 

Visual Studio - Module1:

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


Module Module1
    Dim Nts As Session = Session.GetSession()
    Dim Ufs As UFSession = UFSession.GetUFSession()
    Dim UIs As UI = UI.GetUI()
    Dim Cams As CAM.CAMSession = Nts.CAMSession
    Dim Rus As RemoteUtilities = RemoteUtilities.GetRemoteUtilities()
    Dim theSession As Session = Session.GetSession()
    Dim lw As ListingWindow


    Function udop(ByVal stringIn As String) As Integer

        Dim udopPtr As IntPtr = IntPtr.Zero
        Dim purpose As UFUdop.Purpose
        Dim opName As String = String.Empty
        Dim operPtr As IntPtr = IntPtr.Zero
        Dim pathPtr As IntPtr = IntPtr.Zero
        Dim linearMotion As UFPath.LinearMotion

        Ufs.Udop.AskUdop(IntPtr.Zero, udopPtr)
        Ufs.Udop.AskOper(udopPtr, operPtr)
        Ufs.Udop.AskPurpose(udopPtr, purpose)
        Ufs.Oper.AskName(operPtr, opName)
        Ufs.Oper.AskPath(operPtr, pathPtr)

        ' Set parameters
        If purpose = UFUdop.Purpose.UserParams Then
            lw = theSession.ListingWindow
            lw.Open()
            lw.WriteLine("Udop name " & opName & " Purpose " & purpose)
        End If

        If purpose = UFUdop.Purpose.Generate Then

            'Generate tool path
            Ufs.Path.InitToolPath(pathPtr)
            linearMotion.type = UFPath.MotionType.MotionTypeApproach
            'linearMotion.feed_unit = UFPath.FeedUnit.FeedUnitNone
            'linearMotion.feed_value = 0
            linearMotion.position = {0, 0, 50}
            linearMotion.tool_axis = {0, 0, 1}
            Ufs.Path.CreateLinearMotion(pathPtr, linearMotion)


            'Build CLSF line array
            Dim lines() As String = IO.File.ReadAllLines("D:\test.cls")
            Dim lineArray As New ArrayList()
            For x As Integer = 0 To lines.GetUpperBound(0)
                lineArray.Add(lines(x))
            Next

            For x = 0 To lineArray.Count - 1
                Dim LineOfText As String
                LineOfText = lineArray.Item(x)

                If LineOfText.Contains("GOTO/") Then
                    Dim MyString As String = LineOfText
                    Dim MyChar() As Char = {"G", "O", "T", "O", "/"}
                    Dim NewString As String = MyString.TrimStart(MyChar)

                    linearMotion.type = UFPath.MotionType.MotionTypeCut
                    linearMotion.feed_unit = UFPath.FeedUnit.FeedUnitPerMinute
                    linearMotion.feed_value = 200.0

                    Dim i As Integer
                    Dim MyNewString() As String
                    MyNewString = NewString.Split(",")
                    For i = 0 To UBound(MyNewString)
                        If i = 0 Then
                            linearMotion.position(i) = MyNewString(i)
                        End If
                        If i = 1 Then
                            linearMotion.position(i) = MyNewString(i)
                        End If
                        If i = 2 Then
                            linearMotion.position(i) = MyNewString(i)
                        End If
                    Next i
                    linearMotion.tool_axis(0) = 0
                    linearMotion.tool_axis(1) = 0
                    linearMotion.tool_axis(2) = 1
                    Ufs.Path.CreateLinearMotion(pathPtr, linearMotion)
                End If
            Next

            Ufs.Path.EndToolPath(pathPtr)

        End If

    End Function


    Sub Main()
        lw = theSession.ListingWindow
        lw.Open()
        lw.WriteLine("Entry Point:: Main")
    End Sub

End Module



Public Class otherEntryPoints
    Public Shared Function GetUnloadOption(ByVal arg As String) As Integer
        Return Session.LibraryUnloadOption.Immediately
    End Function
End Class

 

Re: Wrap tool path from planar mill operation

I created an Enhancement Request for adding this functionality to a future release of NX. If any one wants to add their name to that. ER7945401.

Re: Wrap tool path from planar mill operation

Also added an additional ER:Add a Profile and/or Follow Periphery Cut Pattern to Rotary Milling. ER7946480.

Learn online





Solution Information