Option Strict Off Imports System Imports NXOpen Imports NXOpen.UI Imports NXOpen.Utilities Imports NXOpen.UF Module report_spline_thru_points Dim s As Session = Session.GetSession() Dim ufs As UFSession = UFSession.GetUFSession() Sub Main() Dim inx As Integer = 0 Dim spline As NXOpen.Tag Dim degree As Integer Dim periodicity As Integer Dim num_points As Integer Dim point_data() As NXOpen.UF.UFCurve.PtSlopeCrvatr Dim parameters() As Double Dim n As String = vbCrLf While select_a_spline(spline) = Selection.Response.Ok 'MsgBox("Spline Tag:" & spline.ToString()) ufs.Curve.AskSplineThruPts(spline, degree, periodicity, _ num_points, point_data, parameters) ufs.Ui.OpenListingWindow() ufs.Ui.WriteListingWindow("Degree: " & degree.ToString & n) ufs.Ui.WriteListingWindow("Periodicity: " & periodicity.ToString & n) ufs.Ui.WriteListingWindow("Number of points: " & num_points.ToString & n & n) For inx = 0 To num_points - 1 + periodicity ufs.Ui.WriteListingWindow("Point #" & inx.ToString & n) ufs.Ui.WriteListingWindow("Point: " & point_data(inx).point(0) & _ " " & point_data(inx).point(1) & _ " " & point_data(inx).point(2) & n) ufs.Ui.WriteListingWindow("Point slope type: " _ & point_data(inx).slope_type & n) ufs.Ui.WriteListingWindow("Parms: " & parameters(inx).ToString & n & n) Next 'ufs.Disp.SetHighlight(spline, 0) End While End Sub Function select_a_spline(ByRef spline As NXOpen.Tag) As Selection.Response Dim message As String Dim title As String = "Select a spline" Dim scope As Integer = UFConstants.UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY Dim response As Integer Dim obj As NXOpen.Tag Dim view As NXOpen.Tag Dim cursor(2) As Double Dim mask_splines As UFUi.SelInitFnT = AddressOf mask_for_splines ufs.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) Try ufs.Ui.SelectWithSingleDialog(message, title, scope, mask_splines, _ Nothing, response, spline, cursor, view) Finally ufs.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) End Try If response <> UFConstants.UF_UI_OBJECT_SELECTED And _ response <> UFConstants.UF_UI_OBJECT_SELECTED_BY_NAME Then Return Selection.Response.Cancel Else Return Selection.Response.Ok End If End Function Function mask_for_splines(ByVal select_ As IntPtr, _ ByVal userdata As IntPtr) As Integer Dim num_triples As Integer = 1 Dim mask_triples(0) As UFUi.Mask mask_triples(0).object_type = UFConstants.UF_spline_type mask_triples(0).object_subtype = UFConstants.UF_spline_subtype ufs.Ui.SetSelMask(select_, _ UFUi.SelMaskAction.SelMaskClearAndEnableSpecific, _ num_triples, mask_triples) Return UFConstants.UF_UI_SEL_SUCCESS End Function Public Function GetUnloadOption(ByVal dummy As String) As Integer GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY End Function End Module