Hello,
I am using Visual Basic to create a tapped hole on one side of a pipe. The problem that I am running into is that when I use the HoleWizard4 Method that the origin is selected along with the point where I want the tapped hole. So I end up with 2 tapped holes instead of just one tapped hole where I want it.
Here is my process:
Create a point on plane4 (which is the top plane rotated 10 degrees):
boolstatus = swDoc.Extension.SelectByID2("Plane5", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
swDoc.SketchManager.InsertSketch(True)
swDoc.ClearSelection2(True)
skPoint = swDoc.SketchManager.CreatePoint(0.1016, 0.0#, 0.0#)
boolstatus = swDoc.Extension.SelectByID2("Point1@Origin", "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = swDoc.Extension.SelectByID2("Point1@Sketch2", "SKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
swDoc.SketchAddConstraints("sgHORIZONTALPOINTS2D")
boolstatus = swDoc.Extension.SelectByID2("Plane4", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = swDoc.Extension.SelectByID2("Point1@Sketch2", "SKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
swDoc.SketchAddConstraints("sgCOINCIDENT")
swDoc.SketchManager.InsertSketch(True)
swDoc.ClearSelection2(True)
I then preselect that point that I just created and the plane:
boolstatus = swDoc.Extension.SelectByID2("Point1@Sketch2", "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = swDoc.Extension.SelectByID2("Plane5", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
And then add the tapped hole:
myFeature = swDoc.FeatureManager.HoleWizard4(3, 0, 25, "1/4", 0, 0.0111252, 0.035052, 0.0254, 0, 0, 0, 0, 2.059488517353, 1, 0, -1, -1, -1, -1, "", False, True, True, True, False, False)
And for a reason that I haven't found, the origin gets a point on the sketch that defines where the tapped hole gets put so I end up with 2 tapped holes instead of the 1 that I want.
Any Suggestions?
SolidworksApi macros