Hi Petter,
I also converted it to VB.NET and placed it in an existing project which already places a command button on the Ribbon and then executed it from there and it stopped after the measure. You should debug into the program to see why it continues in your case.
Here is my converted part - in case you can spot any difference.
Public Class clsMeasure
'*************************************************************
' The declarations and functions below need to be copied into
' a class module whose name is "clsMeasure". The name can be
' changed but you'll need to change the declaration in the
' calling function "InteractiveMeasureDistance" and
' "InteractiveMeasureAngle" to use the new name.
' Declare the event objects
Private WithEvents oInteractEvents As InteractionEvents
Private WithEvents oMeasureEvents As MeasureEvents
' Declare a flag that's used to determine when measuring stops.
Private bStillMeasuring As Boolean
Private eMeasureType As MeasureTypeEnum
Private ReadOnly Property ThisApplication As Application
Get
Return StandardAddInServer._inventorApplication
End Get
End Property
Public Sub Measure(MeasureType As MeasureTypeEnum)
eMeasureType = MeasureType
' Initialize flag.
bStillMeasuring = True
' Create an InteractionEvents object.
oInteractEvents = ThisApplication.CommandManager.CreateInteractionEvents
' Set a reference to the measure events.
oMeasureEvents = oInteractEvents.MeasureEvents
oMeasureEvents.Enabled = True
' Start the InteractionEvents object.
oInteractEvents.Start()
' Start measure tool
If eMeasureType = MeasureTypeEnum.kDistanceMeasure Then
oMeasureEvents.Measure(MeasureTypeEnum.kDistanceMeasure)
Else
oMeasureEvents.Measure(MeasureTypeEnum.kAngleMeasure)
End If
' Loop until a selection is made.
Do While bStillMeasuring
ThisApplication.UserInterfaceManager.DoEvents()
Loop
' Stop the InteractionEvents object.
oInteractEvents.Stop()
' Clean up.
oMeasureEvents = Nothing
oInteractEvents = Nothing
End Sub
Private Sub oInteractEvents_OnTerminate() Handles oInteractEvents.OnTerminate
' Set the flag to indicate we're done.
bStillMeasuring = False
End Sub
Private Sub oMeasureEvents_OnMeasure(ByVal MeasureType As MeasureTypeEnum, ByVal MeasuredValue As Double, ByVal Context As NameValueMap) Handles oMeasureEvents.OnMeasure
Dim strMeasuredValue As String
If eMeasureType = MeasureTypeEnum.kDistanceMeasure Then
strMeasuredValue = ThisApplication.ActiveDocument.UnitsOfMeasure.GetStringFromValue(MeasuredValue, UnitsTypeEnum.kDefaultDisplayLengthUnits)
MsgBox("Distance = " & strMeasuredValue, vbOKOnly, "Measure Distance")
Else
strMeasuredValue = ThisApplication.ActiveDocument.UnitsOfMeasure.GetStringFromValue(MeasuredValue, UnitsTypeEnum.kDefaultDisplayAngleUnits)
MsgBox("Angle = " & strMeasuredValue, vbOKOnly, "Measure Angle")
End If
' Set the flag to indicate we're done.
bStillMeasuring = False
End Sub
End Class
' Functionality of the command button on the Ribbon
Protected Overrides Sub ButtonDefinition_OnExecute(ByVal context As NameValueMap)
' Create a new clsMeasure object.
Dim oMeasure As New clsMeasure
' Call the Measure method of the clsMeasure object
Call oMeasure.Measure(MeasureTypeEnum.kDistanceMeasure)
End Sub
If you are still having issues then please create a very basic .NET project with the code in it and attach it to your reply.
Cheers,

Adam Nagy
Autodesk Platform Services