Find Node Associated With Mesh Point

Hello All,

I am looking to get the node label from a mesh point after the mesh has been updated to include a node at the new meshpoint.

The code I have written takes in a selected meshpoint and I am trying to get the node label from that mesh. Unfortunately it doesn't get the node label.

Sub meshpointNodeLabel(meshpoint)

Dim workFemPart As NXOpen.CAE.FemPart = CType(theSession.Parts.BaseWork, NXOpen.CAE.FemPart)
Dim displayFemPart As NXOpen.CAE.FemPart = CType(theSession.Parts.BaseDisplay, NXOpen.CAE.FemPart)

Dim tagObj As NXOpen.TaggedObject = meshpoint(0)
Dim point As NXOpen.Point = tagObj
Dim point3d As NXOpen.Point3d = point.Coordinates

'Function that sets meshpoint as NXOpen.CAE.MeshPoint
Dim meshpoint1 As NXOpen.CAE.MeshPoint = GetClosestMeshPoint(point3d)

Dim meshPointProjectBuilder1 As NXOpen.CAE.MeshPointProjectBuilder = Nothing
meshPointProjectBuilder1 = workFemPart.MeshPoints.CreateMeshpointProjectBuilder()
meshPointProjectBuilder1.ProjectionTolerance = 0.001
meshPointProjectBuilder1.MeshPointToEdit = meshpoint1
Dim meshNodeLabel As Integer = meshPointProjectBuilder1.NodeLabel

Dim meshPointExistingPointBuilder1 As NXOpen.CAE.MeshPointExistingPointBuilder = Nothing
meshPointExistingPointBuilder1 = workFemPart.MeshPoints.CreateMeshpointExistingPointBuilder()
meshPointExistingPointBuilder1.MeshPointToEdit = meshpoint1
Dim meshNodeLabel2 As Integer = meshPointExistingPointBuilder1.NodeLabel

theLW.Open()
theLW.WriteLine("The node label is: " & meshNodeLabel.ToString & " " & meshNodeLabel2.ToString)
End Sub