Hi all I Have a problem with a macro .
I want to make a cut revolve out from a sketch but the problem is that the lines with the desired cordinates i want doesnt get good done
when i run this macro it generate a sketch with X cordinatesthat always take 0 value
Private Sub insertplenses_click()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSketch As SldWorks.Sketch
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SetUserPreferenceDouble(swUserPreferenceDoubleValue_e.swGridMajorSpacing, 0, 0.000001)
boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsLinearDecimalPlaces, 0, 8)
boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsLinearFractionDenominator, 0, 0)
boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swUnitsLinearFeetAndInchesFormat, 0, False)
boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsDualLinearDecimalPlaces, 0, 8)
boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsDualLinearFractionDenominator, 0, 0)
boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swUnitsDualLinearFeetAndInchesFormat, 0, False)
boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsAngularDecimalPlaces, 0, 8)
boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
Dim myRefPlane As Object
Set myRefPlane = Part.FeatureManager.InsertRefPlane(264, 0.0015, 0, 0, 0, 0)
myRefPlane.Name = "Planplense"
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Planplense", "PLANE", 0.0015, 0.0015, 0.0015, False, 0, Nothing, 0)
Part.SketchManager.InsertSketch True
Part.ClearSelection2 True
Dim swFeat As Feature
Set swFeat = Part.FeatureByPositionReverse(0)
swFeat.Name = "Sketchlense"
Part.ClearSelection2 True
Set skSegment = Part.SketchManager.CreateLine(0.00152290591, 0.01276819236, 0#, 0.00162122749, 0.01276497929, 0#)
Set skSegment = Part.SketchManager.CreateLine(0.00152290591, 0.01276819236, 0#, 0.00150378417, 0.01270035984, 0#)
Set skSegment = Part.SketchManager.CreateLine(0.00162122749, 0.01276497929, 0#, 0.00165309212, 0.01270611481, 0#)
Set skSegment = Part.SketchManager.CreateTangentArc(0.00150378417, 0.01270035984, 0#, 0.00165309212, 0.01270611481, 0#, 2)
Set skSegment = Part.SketchManager.CreateCenterLine(0.0015, 0.018, 0#, 0.0015, 0.01, 0)
Part.ClearSelection2 True
Part.SketchManager.InsertSketch True
boolstatus = Part.Extension.SelectByID2("Line4@Sketchlense", "EXTSKETCHSEGMENT", 1.691843240792E-04, 0.01283727753747, -0.0015, False, 16, Nothing, 0)
Dim myFeature As Object
Set myFeature = Part.FeatureManager.FeatureRevolve2(True, True, False, True, False, False, 0, 0, 6.28318530718, 0, False, False, 0.01, 0.01, 0, 0, 0, True, True, True)
Part.SelectionManager.EnableContourSelection = False
End Sub
Please I need an Urgent Help
Thanks
SolidworksApi macros