Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Creating a feature script to mark bends

kyle_hofer465kyle_hofer465 Member Posts: 2
Hi,
Can someone please help me create a feature script to mark bends when the part is flattened? So basically what I want to do is select the points on each end of the bend lines and have it snap a circle sketch to each point selected. Also instead of having to define the diameter of every single one of them with the dimension tool, I need the circles to be equal to each other by default and control the diameter of the circle within the feature script.

Once done, my flat pattern will have a half-moon remove extruded on each end of my bend lines, Then those will help me show where my bend lines are after the laser cut process, generating less room for error when doing the bending process.

Any help on this would be greatly appreciated!

Kind Regards,
Kyle


Comments

  • EvanReeseEvanReese Member, Mentor Posts: 2,776 PRO
    Can you share an image of the end goal? It's hard for me to follow along by text only
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • bryan_lagrangebryan_lagrange Member, User Group Leader Posts: 964 ✭✭✭✭✭
    @Evan_Reese I believe @kyle_hofer465 is looking to have a script that puts a cut that shows where the bend line is on a part so you can use to line up with tooling at a brake to make a bend.

    https://cad.onshape.com/documents/073ee8501e1fab82fbe32b8e/w/5a9425f9ac5675c512e36202/e/158a842299199529b1bf6b22


    Bryan Lagrange
    Twitter: @BryanLAGdesign

  • EvanReeseEvanReese Member, Mentor Posts: 2,776 PRO
    Ah I get it, thanks! I can definitely see the utility of it. I've not worked with sheet metal in Featurescript at all, but it does seem like a good candidate. @MBartlett21 would know better than me how hard or easy it might be, given all of the sheet metal specific features he's made.
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    edited February 2022
    @Evan_Reese

    If you can get selecting the endpoints or the lines to work, you should be able to just sketch on a face of the flat pattern (remembering that the sketch will be in the coordinates of that face with evPlane, not world coordinates), then there are two ways of cutting the flat.

    The simpler way would likely be to just call `extrude` from your FeatureScript and have it handle updating the flat pattern and everything (having a look at its precondition to see what you need to provide to it for operating on the flat.)

    The other way would be to look at the inner workings of extrude (calling opSMFlatOperation and whatnot) and copy that into your feature.


    Also, maybe a little bit unrelated, but wouldn't having a sharp wedge-shaped cut be a bit more accurate than a circle?
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • EvanReeseEvanReese Member, Mentor Posts: 2,776 PRO
    Thanks for the primer, Morgan. I doubt I'd get around to this any time soon, but it does seem like a good job for FS.
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 864 ✭✭✭✭✭
    Thanks for the primer, Morgan. I doubt I'd get around to this any time soon, but it does seem like a good job for FS.
    It would be even better if instead of a cut a mark was added
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • dirk_van_der_vaartdirk_van_der_vaart Member Posts: 561 ✭✭✭

  • jason_1jason_1 Member Posts: 29 PRO

    I've been meaning to make a very similar feature for a while now and have been manually adding the > and < cuts to my bends to help with alignment.

    Now I'd also like to make a version with a dashed thin cut extrude (for easier bending on laser cut flats). Is there a way to select the all the dashed bend lines in the flat pattern with either FS or using the new query variables? They don't even seem like sketch entities although the dashed lines can be "used" to create lines in another sketch.

    Did anyone else end up making this custom feature in the past 4 years? :D Sorry for the bump, but I'm happy to pick up the ball if there isn't something already already done!

  • nick_papageorge_dayjobnick_papageorge_dayjob Member, csevp Posts: 1,047 PRO

    Not a solution to the exact question, but you can use a 3rd party dxf tool to change the color of the bend line, if you export from OS with the bend line. Then the vendor will treat that line as a line to etch, rather than thru cut. That is what I was doing with SendCutSend. I emailed their help how to etch the bend lines, and they had me change them to a different color (or maybe a dashed line, I forget now). Later, I got much smarter, and had them do all the cutting and bending.

    Thinking back, sometimes that line would be on the wrong side of the bend, and harder to line up on the brake.

  • Caden_ArmstrongCaden_Armstrong Member Posts: 374 PRO

    I made a feature like this last year and is up for sale on fs.place https://fs.place/Listings/DV4I2TLAR6ZU61QH37M6IZAW30VY7CJD
    Its only $20, you can see a demo of it here: https://cad.onshape.com/documents/a74c45e865d1f5b41a5e6c6e/w/cb6fbcc5186057491e42639a/e/fc13fdba9d4759c7bd509f65

    www.smartbenchsoftware.com --- Renaissance --- fs.place
    Experts in Onshape Automation - Custom Features and Integrated Applications
Sign In or Register to comment.