Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NXOpen AskBoundaries error with CamDrive

Status
Not open for further replies.

rvogel

Aerospace
Feb 19, 2014
4
I am attempting to find the number of drive boundaries within a fixed-contour Cam operation and am having the same issue as found in this post.

Any help would be greatly appreciated.
This is the code that I am using:
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module ask_boundary_count

    Dim theSession As Session = Session.GetSession()
    Dim WorkPart As Part = theSession.Parts.Work
    Dim DisplayPart As Part = theSession.Parts.Display
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()
        If WorkPart IsNot Nothing Then
            Dim setupTag As Tag
            ufs.Cam.InitSession()
            ufs.Setup.AskSetup(setupTag)
            Try
                Dim selectedTags() As NXOpen.Tag
                Dim selectedCount As Integer
                lw.Open()
                lw.WriteLine(vbLf & "Searching for selected nodes...")
                ufs.UiOnt.AskSelectedNodes(selectedCount, selectedTags)
                If selectedCount <= 0 Then
                    lw.WriteLine("No CAM node selected...exit")
                    Return
                End If
                lw.WriteLine(" Found " & selectedCount & " selected nodes...")
                Dim inx As Integer = 0
                Dim setBnd() As IntPtr
                ufs.Cambnd.AskBoundaries(selectedTags(0), CamGeomType.CamDrive, inx, setBnd)
                lw.WriteLine("count " & inx)
            Catch ex As NXOpen.NXException
                lw.Open()
                lw.WriteLine("Error: ")
                lw.WriteLine(ex.Message)
            End Try
        End If
    End Sub

End Module


thread561-265526
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor