I'm not very good at explaining these things but hopefully the code below will help. your line is hi-lited in yellow
Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.UF
Module PointCloudTools2
Dim s As Session = Session.GetSession()
Dim ui As UI = UI.GetUI()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = s.ListingWindow
Dim wp As Part = s.Parts.Work
Sub Main()
Dim response As Selection.Response = Nothing
Dim dplane1 As DatumPlane = Nothing
Dim lw As ListingWindow = s.ListingWindow
[highlight #EF2929] response = selectDatumPlane(dplane1)
If response = Selection.Response.Cancel Or response = Selection.Response.Back _
Then GoTo End1[/highlight]
[highlight #FCE94F] Dim datumPlane1 As DatumPlane = dplane1[/highlight]
lw.Open
lw.WriteLine(datumPlane1.Layer.ToString)
lw.Close
End1:
End Sub
Function selectDatumPlane(ByRef object1 As DatumPlane) As Selection.Response
Dim selectionMask_array(0) As Selection.MaskTriple
selectionMask_array(0).Type = UFConstants.UF_datum_plane_type
selectionMask_array(0).Subtype = 0
selectionMask_array(0).SolidBodySubtype = 0
Dim cursor As Point3d = Nothing
Dim resp As Selection.Response = _
ui.SelectionManager.SelectTaggedObject("Datum Plane Selection", "Select a DatumPlane", _
Selection.SelectionScope.WorkPart, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, selectionMask_array, object1, cursor)
If resp = Selection.Response.ObjectSelected Or _
resp = Selection.Response.ObjectSelectedByName Then
Return Selection.Response.Ok
ElseIf resp = Selection.Response.Back Then
Return Selection.Response.Back
ElseIf resp = Selection.Response.Cancel Then
Return Selection.Response.Cancel
End If
End Function
End Module