Hi @Anonymous. When using the Pick method, you either have to define the variable as the correct object Type (to match the filter), or you have to not define the variable's Type ahead of time, to avoid errors. Then, it's usually best to check if any value was given to the variable, in case you canceled out of it without picking something (I didn't do that in my example). If you chose to not define the variable's Type ahead of time, then you may need to check the variable's Type afterwards, especially when there may be a small range of actual object types that may be returned by the specified selection filter. In this case, you are trying to get an actual Sketch3D object, so the variable's type would need to be defined as Sketch3D to match the filter. But you still can't select that Sketch3D object directly within the model space, and must instead select it from the model browser tree, to make this rule work.
Dim oS3D As Sketch3D = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketch3DObjectFilter, "Select a Sketch Curve.")
If IsNothing(oS3D) Then Return
MsgBox("You picked a 3D Sketch named " & oS3D.Name)
However, as stated before, if you want to select the Sketch3D object by selecting some geometry belonging to it within the model space, you could do that this way:
Dim oSE3D As SketchEntity3D = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketch3DDefaultFilter, "Select a 3D Sketch entity.")
If IsNothing(oSE3D) Then Return
MsgBox("You picked a 3D Sketch named " & oSE3D.Parent.Name)
ThisDoc.Document.SelectSet.Select(oSE3D.Parent)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)