Creating a point in the "drilling assistance" function

Hi all

My goal is to make a macro that removes the insertion point of my hole and then adds one on a given position. However, I have a problem, the " createpoint " function does place a point at the desired coordinates but does not attach the point to the pierced surface (even though it does give the given coordinates). So my drilling is not done because it does not find the associated surface.

Has anyone ever manipulated this function?

Thank you.

Put an example it will be simpler

At home it works

Sub main()
Dim swApp As Object
Dim Part As Object
Dim myModelView As Object
Dim skPoint As Object

Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set myModelView = Part.ActiveView

Set skPoint = Part.SketchManager.CreatePoint(0, 0, 0#)
Part.SetPickMode
Part.ClearSelection2 True
End Sub
2 Likes

Point sur plan
In fact, it's not the point creation function that doesn't work, it's more that the point created doesn't suit the function

The point create here is confused with the plan but not " on the plane " as the constraint would allow me to do but manually

the question is therefore is it possible to create the point (which is in a 3D sketch) directly with the constraint " on the plane "?

Look at the api on how to retrieve and add a point in this function.
If I'm not mistaken, it should help you:
https://help.solidworks.com/2022/English/api/sldworksapi/Get_Sketch_Points_in_Wizard_Hole_Example_VB.htm