SolidWorks Macro Drilling Support

Hi all

I'm working on a macro that by entering the reference of an axis in the userform creates it for us in dimentions and makes us the plan with dimensions and tolerances as well as other things.

In the reference of the axis we can find U01 up to U21 which are predefined and dimensioned operations. And in one of them there is an M2 thread offset by 1.5mm from the edge of the axis, here is my line of code:

Part.FeatureManager.HoleWizard2 4, 8, 147, "M2", 0, 0.0016, 0.006, 0.004, 0.00205, 1, 0, 0, 2.059488517353, 2, 0, 0, 0, -1, -1, "", false, 1, 1, 1, 1, 1

And I'm looking for the part of this code where we define the position of the hole on the plane. Or another solution to position the point of my piercing. For the moment my drilling is done in x0 and y0.

Thank you in advance for your answers and your time