Hi all
I don't have any training in APIs but I have to create a code allowing us, by entering the reference of an axis, to build it to the right dimensions etc
I have already finished this code but when the customer Ø is < 6.35 we have a shoulder of Ø6.35 by 0.5mm.
And if it is greater than or equal to 6.35, we have instead of the shoulder the customer Ø on the customer length
I've already tried this but it still gives me a shoulder now:
If O < 6.35 Then
Set sksegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, Diam / 2) 'Circle dimensions (Ø)+ position
Set sksegment = Part.FeatureManager.FeatureExtrusion2(True, False, False, 0, 0, 0.5 / 1000, 0.01, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1, 0, 0, False)
boolstatus = Part.Extension.SelectByID2("Plan4", "PLANE", 0, 0, 0, False, 0, Nothing, 0) 'Created a plan and then extruded from it
Part.CreatePlaneAtOffset3 0.5/1000, False, True 'Distances are defined by the 1st length
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Plan5", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Set sksegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, O / 2) 'Circle Dimensions (Ø)+ Position
Set sksegment = Part.FeatureManager.FeatureExtrusion2(True, False, False, 0, 0, M - 0.7 / 1000, 0.01, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1, 0, 0, False)
boolstatus = Part.Extension.SelectByID2("Plan5", "PLANE", 0, 0, 0, False, 0, Nothing, 0) 'Created a plan and then extruded from it
Part.CreatePlaneAtOffset3 M - 0.7/1000, False, True 'Distances are defined by the 1st length
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Plan6", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Set sksegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, O/2)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Plan6", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.SketchManager.InsertSketch True
boolstatus = Part.Extension.SelectByID2("Plan6", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
ElseIf O >= 6.35 Then
Set sksegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, O / 2) 'Circle Dimensions (Ø)+ Position
Set sksegment = Part.FeatureManager.FeatureExtrusion2(True, False, False, 0, 0, M - 0.7 / 1000, 0.01, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1, 0, 0, False)
boolstatus = Part.Extension.SelectByID2("Plan4", "PLANE", 0, 0, 0, False, 0, Nothing, 0) 'Created a plan and then extruded from it
Part.CreatePlaneAtOffset3 M - 0.7/1000, False, True 'Distances are defined by the 1st length
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Plan5", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Set sksegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, O/2)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Plan5", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.SketchManager.InsertSketch True
boolstatus = Part.Extension.SelectByID2("Plan5", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
End If
If anyone has a solution, I'm all ears.
Sincere greetings