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:
thread561-265526
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