Featurescript - Sheet Metal Thicken

Austin_Keet
Austin_Keet Member Posts: 6 ✭
Hello, I have a simple task. I am trying to create a sheet metal model by thickening it from a sketch in a featurescript. My FeatureScript creates the sketch correctly, however I am uncertain on how to use the sheet metal commands. Any guidance would be greatly appreciated! 

Comments

  • MBartlett21
    MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    Call sheetMetalStart
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • Austin_Keet
    Austin_Keet Member Posts: 6 ✭
    Thanks for the reply mbartlett21. After looking through the library's sheet metal functions though I still don't understand. Where do I call sheetMetalStart? How do I do what I want to do after I call sheetMetalStart? If you have an example that would be great!  :)

    There is "SMProcessType.THICKEN" which looks like it might be what I want? But I have no idea how to assign the value of thickness that I want.

  • MBartlett21
    MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    You can look up this link for the sheetMetalStart function
    https://cad.onshape.com/documents/12312312345abcabcabcdeff/w/a855e4161c814f2e9ab3698a/e/d72cde0155be691657609507?jumpToIndex=3679

    Callit by inserting

    sheetMetalStart(context, id + "<b><i>SM_ID</i></b>", {<br>        "process" : SMProcessType.THICKEN,<br>&nbsp;       "regions" : <b><i>Sketch_Regions</i></b>,<br>&nbsp;       "thickness" : <b><i>Sm_Thickness</i></b>,<br>&nbsp;       "radius" : <b><i>Bend_Radius</i></b>,<br>&nbsp;       "kFactor" : <b><i>K_Factor</i></b>,<br>&nbsp;       "kFactorRolled" : <b><i>K_Factor_Rolled</i></b><br>    })



    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • Austin_Keet
    Austin_Keet Member Posts: 6 ✭
    Thanks! Helped a lot and I have it now.

    In case anyone reads this later I did have to add "bends" : qSketchRegion(id+("sketch1")~j)), in the code. Let me know if I shouldn't have inputted the sketch as the query for bends though haha
     
     sheetMetalStart(context, id + "SM_ID", {
           "process" : SMProcessType.THICKEN,
           "regions" : qSketchRegion(id + ("sketch1"~j)),
           "bends" : qSketchRegion(id + ("sketch1"~j)),
           "thickness" : thickness,
           "radius" : 0.25 * inch,
           "kFactor" : 0.5,
           "kFactorRolled" : 0.5
           });
  • lana
    lana Onshape Employees Posts: 782 image
    edited November 2018
    @Austin_Keet

    You probably had to supply a query for bends parameter, it should not be  qSketchRegion(id + ("sketch1"~j)), even though it gets ignored. Please use qNothing() instead - it is exactly what it says it is.
  • Austin_Keet
    Austin_Keet Member Posts: 6 ✭
    @lana
    Awesome, thanks lana