Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Insertion du cube
  2. Part.SketchManager.InsertSketch (True)
  3. Part.SketchManager.AddToDB = False
  4. Part.SketchManager.InsertSketch True
  5. Part.ClearSelection2 True
  6. boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swSketchAddConstToRectEntity, swUserPreferenceOption_e.swDetailingNoOptionSpecified, False)
  7. boolstatus = Part.Extension.SetUserPreferenceToggle(swUserPreferenceToggle_e.swSketchAddConstLineDiagonalType, swUserPreferenceOption_e.swDetailingNoOptionSpecified, True)
  8. Dim vSkLines As Variant
  9. vSkLines = Part.SketchManager.CreateCornerRectangle(0, 0, 0, length, length, 0)
  10. Dim myFeature As Object
  11. Set myFeature = Part.FeatureManager.FeatureExtrusion2(True, False, False, 0, 0, 0.06, 0.01, False, False, False, False, 1.74532925199433E-02, 1.74532925199433E-02, False, False, False, False, True, True, True, 0, 0, False)
  12.  
  13. 'Insertion d 'une sphère
  14. boolstatus = Part.Extension.SelectByID2("Plan de face", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
  15. Part.SketchManager.InsertSketch True
  16. Part.ClearSelection2 True
  17. Set skSegment = Part.SketchManager.CreateCenterLine(0#, 0#, 0#, -rayon * 2, 0#, 0#)
  18. Part.SetPickMode
  19. Part.ClearSelection2 True
  20. Set skSegment = Part.SketchManager.Create3PointArc(-rayon * 2, 0#, 0#, 0#, 0#, 0#, -0.007195, -rayon, 0#)
  21. boolstatus = Part.Extension.SelectByID2("Point4", "SKETCHPOINT", -6.1350289617321E-03, -2.21884825168814E-03, 0, False, 0, Nothing, 0)
  22. boolstatus = Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", -6.48958462346347E-03, -3.37946151612256E-04, 3.56782210049191E-02, True, 0, Nothing, 0)
  23. Part.SketchAddConstraints "sgATMIDDLE"
  24. Part.ClearSelection2 True
  25. boolstatus = Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
  26. Part.ClearSelection2 True
  27. boolstatus = Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0, 0, 0, False, 16, Nothing, 0)
  28. Set myFeature = Part.FeatureManager.FeatureRevolve2(True, True, False, False, False, False, 0, 0, 6.2831853071796, 0, False, False, 0.01, 0.01, 0, 0, 0, False, True, True)
  29. Part.SelectionManager.EnableContourSelection = False
  30. Part.ClearSelection2 True
  31.  
  32. 'Répétition par esquisee
  33. boolstatus = Part.Extension.SelectByID2("Esquisse3D1", "SKETCH", 0, 0, 0, False, 64, Nothing, 0)
  34. boolstatus = Part.Extension.SelectByID2("Révolution1", "SOLIDBODY", -6.74308053442019E-03, 2.69252183593949E-03, 5.47894052022002E-03, True, 256, Nothing, 0)
  35. Part.FeatureManager.FeatureSketchDrivenPattern True, False
  36. boolstatus = Part.Extension.SelectByID2("Révolution1", "SOLIDBODY", 0, 0, 0, True, 0, Nothing, 0)
  37. boolstatus = Part.Extension.SelectByID2("Révolution1", "SOLIDBODY", 0, 0, 0, True, 0, Nothing, 0)
  38.  
  39. 'Suppression de la première révolution
  40. boolstatus = Part.Extension.SelectByID2("Révolution1", "SOLIDBODY", -9.00371912371156E-03, 3.2719117743909E-03, 4.32472761337976E-03, True, 0, Nothing, 0)
  41. Set myFeature = Part.FeatureManager.InsertDeleteBody2(False)
  42.  
  43. 'Cacher l'esquisse 3D1
  44. boolstatus = Part.Extension.SelectByID2("Esquisse3D1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
  45. Part.BlankSketch
  46.  
  47.  
  48. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement