AnsweredAssumed Answered

Selecting Active sketch for cut extrude

Question asked by Kevin Schippers on Feb 7, 2020
Latest reply on Feb 7, 2020 by Mike Spens

I have cut extrude parameters that are used repeatedly with multiple sketches and parts. I would like to create a macro where the user selects a sketch and runs the macro to cut with these parameters. This is what I have recorded. 

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Sketch4", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Sketch4", "SKETCH", 0, 0, 0, False, 4, Nothing, 0)
Dim myFeature As Object
Set myFeature = Part.FeatureManager.FeatureCutThin2(True, False, False, 0, 1, 0.000381, 0.0015875, False, False, False, False, 1.74532925199433E-02, 1.74532925199433E-02, False, False, False, False, 0.0000254, 0.0015875, 0.0000254, 2, 0, False, 0.005, True, True, 0, 0, False)
Part.SelectionManager.EnableContourSelection = False
End Sub