Problems with creating a dimension in a 3D-Sketch

Hi there,

I try to create a dimension in a 3d sketch. With 2d-sketches thecode works fine. Within the 3d sketch the IAddDimension2 returnsNothing. I tried several points for IAddDimension2 that I hadrecorded with the macro recorder.
When I look at the 3d sketch the two points are selected andSolidWorks waits for an additional placement point for thedimension. Even the selection of another point after calling theIAddDimension2 function didn't solve this problem.

...
Dim myModelDoc As IModelDoc2 = CType(swApp.ActiveDoc,SolidWorks.Interop.sldworks.ModelDoc2)
Dim myModelDocExt As IModelDocExtension = myModelDoc.Extension
Dim mySketchManager As ISketchManager = myModelDoc.SketchManager
Dim bool_swInputDimValOnCreate As Boolean =swApp.GetUserPreferenceToggle(swUserPreferenceToggle_e.swInputDimValOnCreate)
Dim skPoint_P1 As ISketchPoint = Nothing
Dim skPoint_P2 As ISketchPoint = Nothing
Dim myDDim_P1 As IDisplayDimension = Nothing
Dim myDim_P1 As IDimension = Nothing

swApp.SetUserPreferenceToggle(swUserPreferenceToggle_e.swInputDimValOnCreate,False)
mySketchManager.AddToDB = True
mySketchManager.Insert3DSketch(True)
skPoint_P1 = mySketchManager.CreatePoint(0.0, 0.0, 0.0)
skPoint_P2 = mySketchManager.CreatePoint(0.0, 0.0, 1.0)
skPoint_P1.Select4(False, Nothing)
skPoint_P2.Select4(True, Nothing)
myDDim_P1 = myModelDoc.IAddDimension2(0.0, 0.01, 0.5)
If myDDim_P1 IsNot Nothing Then
myDim_P1 = myDDim_P1.GetDimension2(0)
myDim_P1.Name = "mydim1"
End If
myModelDoc.ClearSelection2(True)
mySketchManager.AddToDB = False
swApp.SetUserPreferenceToggle(swUserPreferenceToggle_e.swInputDimValOnCreate,bool_swInputDimValOnCreate)
...

TIA Matthias SenffSolidworksApi macros