Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim swApp As Object
- Dim Part As Object
- Dim boolstatus As Boolean
- Dim longstatus As Long, longwarnings As Long
- Dim skSegment As Object
- Sub main()
- Set swApp = Application.SldWorks
- Set Part = swApp.ActiveDoc
- boolstatus = Part.Extension.SelectByID2("Plan de face", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
- Part.SketchManager.InsertSketch True
- Dim skSegment As Object
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.015723, 0.009153, 0#)
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.023747, 0.01492, 0#)
- Part.ClearSelection2 True
- 'Renommer l'esquisse
- Set swSketch = Part.GetActiveSketch2
- Set swFeat = swSketch
- swFeat.Name = "esq1"
- 'Cotation 1
- boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D1@esq1").SystemValue = 40 / 1000
- 'Cotation 2
- boolstatus = Part.Extension.SelectByID2("Arc2", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D2@esq1").SystemValue = 60 / 1000
- Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 6, 0, 0.01, 0.01, False, False, False, False, 0, 0, False, False, False, False, True, True, True, 0, 0, False)
- Part.SelectionManager.EnableContourSelection = False
- Part.ClearSelection2 True
- boolstatus = Part.Extension.SelectByID2("Plan de face", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
- Part.SketchManager.InsertSketch True
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.023747, 0.01492, 0#)
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.054088, 0.023947, 0#)
- Part.ClearSelection2 True
- 'Renommer l'esquisse
- Set swSketch = Part.GetActiveSketch2
- Set swFeat = swSketch
- swFeat.Name = "esq2"
- 'Cotation 1
- boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D1@esq2").SystemValue = 60 / 1000
- 'Cotation 2
- boolstatus = Part.Extension.SelectByID2("Arc2", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D2@esq2").SystemValue = 160 / 1000
- Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 6, 0, 0.005, 0.005, False, False, False, False, 0, 0, False, False, False, False, True, True, True, 0, 0, False)
- Part.SelectionManager.EnableContourSelection = False
- Part.ClearSelection2 True
- boolstatus = Part.Extension.SelectByID2("Plan de face", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
- Part.SketchManager.InsertSketch True
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.054088, 0.023947, 0#)
- Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#, 0.072393, 0.002382, 0#)
- Part.ClearSelection2 True
- 'Renommer l'esquisse
- Set swSketch = Part.GetActiveSketch2
- Set swFeat = swSketch
- swFeat.Name = "esq3"
- 'Cotation 1
- boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D1@esq3").SystemValue = 160 / 1000
- 'Cotation 2
- boolstatus = Part.Extension.SelectByID2("Arc2", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
- Set myDisplayDim = Part.AddDimension2(0, 0, 0)
- Part.Parameter("D2@esq3").SystemValue = 180 / 1000
- Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 6, 0, 0.008, 0.008, False, False, False, False, 0, 0, False, False, False, False, True, True, True, 0, 0, False)
- Part.SelectionManager.EnableContourSelection = False
- Part.ClearSelection2 True
- 'Dim myFeature As Object
- 'Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 6, 0, 0.01, 0.01, False, False, False, False, 1.74532925199433E-02, 1.74532925199433E-02, False, False, False, False, True, True, True, 0, 0, False)
- 'Part.SelectionManager.EnableContourSelection = False
- 'Part.ClearSelection2 True
- End Sub
Add Comment
Please, Sign In to add comment