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.

What variables do you set up often?

EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
I'm writing a feature that makes it easier to call variables that I create often in many projects, and figure I should make it more widely usable if I can. Most of my common variables are related to Design for Manufacturing (DFM). For example, I do a lot of plastics, so things like #nominal_thickness, #rib_thickness, #main_draft, #min_draft, _#shutoff_draft, etc. It would be different for CNC or laser cutting or sheet metal. What variables do you find yourself writing over and over again?
Evan Reese

Comments

  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    For laser or saw cutting kerf might be nice to have.
  • matthew_stacymatthew_stacy Member Posts: 487 PRO
    @Evan_Reese, I frequently use an index/count variable (#n) to drive axisymmetric parts so that sketch profiles / pattern instance counts / etc update together.

    Tangential to your questions, is there any way you could make these variables global:
    1. between document tabs, or even better
    2. between documents?
    That would be fabulous.  I don't know if this would be possible to implement in Onshape yet.


  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    For laser or saw cutting kerf might be nice to have.
    Good call! I actually already added that, as well as dimensions for slot nodes and corner relief cut diameter. 
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    @Evan_Reese, I frequently use an index/count variable (#n) to drive axisymmetric parts so that sketch profiles / pattern instance counts / etc update together.

    Tangential to your questions, is there any way you could make these variables global:
    1. between document tabs, or even better
    2. between documents?
    That would be fabulous.  I don't know if this would be possible to implement in Onshape yet.


    I'll probably leave a "count" to be handled by the native variable feature. I'm trying to stick to manufacturing process-specific sets of variables. I think it's possible to write a second feature that you could use to bring variables from one part studio to another, even across documents. In fact the custom Super Derive feature can already do this. Global variables aren't really the itch this feature is trying to scratch though. For that, I just write them in a feature studio and add that feature to the top of any relevant part studio. I'm planning on making a video about that soonish.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    Here's the first pass at the feature so you can see what I'm getting at. I welcome any suggestions for additional processes to support or other relevant variables you're interested in.
    https://cad.onshape.com/documents/9e1fae833b03bb1aed93665e/v/c6ee4da8540cba1af3ebcf43/e/779aedaeebf19154364cb0f5
    Evan Reese
  • S1monS1mon Member Posts: 2,989 PRO
    This is cool idea and interesting to see that Featurescript can be used this way (to create variables and not geometry). I like that there are rational limits and structure, but I'm trying to figure out exactly what problems you're trying to solve. Would some standard "start parts" with appropriate variables for particular part types make sense?

    When the variables are buried in the feature, they feel less visible. 

    As a tangent... I've avoided using variables in Solidworks because if you delete a feature or sketch which is hooked up to the variable, it doesn't handle that in a very friendly way. What's your thought on where Onshape's variables work well, and where they fall down? 
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    S1mon said:
    This is cool idea and interesting to see that Featurescript can be used this way (to create variables and not geometry). I like that there are rational limits and structure, but I'm trying to figure out exactly what problems you're trying to solve. Would some standard "start parts" with appropriate variables for particular part types make sense?

    When the variables are buried in the feature, they feel less visible. 

    As a tangent... I've avoided using variables in Solidworks because if you delete a feature or sketch which is hooked up to the variable, it doesn't handle that in a very friendly way. What's your thought on where Onshape's variables work well, and where they fall down? 
    It's pretty common for the top of my tree to look something like this.

    It's a repetitive task to set up and name them, I like the naming convention consistent across our team, it doesn't have relevant default values, and I don't like having to edit each variable one feature at a time. If I'm modeling 2 plastic parts in one studio, I usually like to have separate variables for that one too, so I can change them independently later. I get what you're saying about them being a bit less visible, but I usually have them in a closed folder anyway. A double click to edit the feature doesn't bother me. By "start part" do you mean a tab that's already got this set up that I just copy as a template? Might be the Ikea effect at work here, but I'd still prefer this custom feature over that workflow. I'm sure there are plenty of ways to solve this problem (which is already fairly mild, as problems go).
    Evan Reese
  • matthew_stacymatthew_stacy Member Posts: 487 PRO
    @Evan_Reese what about defining one or more corner radii for pockets, slots, and other machined interior corners.  It might also be useful to specify 1 or more ball end mill diameters. 

    Notionally each of those variables would be slightly larger than a standard end mill diameter.  The overall intent is to encourage standardization on a small number of cutting tools to minimize tooling changes and machining cost for your mold or other machined part.

  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    @Evan_Reese what about defining one or more corner radii for pockets, slots, and other machined interior corners.  It might also be useful to specify 1 or more ball end mill diameters. 

    Notionally each of those variables would be slightly larger than a standard end mill diameter.  The overall intent is to encourage standardization on a small number of cutting tools to minimize tooling changes and machining cost for your mold or other machined part.

    I like this idea. I haven't done a lot of CNC machining myself (meaning I've not had to set up and run the machine) so there are probably some things I could get more efficient on. Would just calling the feature a few times as-is work if you prepend each one with c1, c2 etc for each cutter you want to use?
    Evan Reese
  • matthew_stacymatthew_stacy Member Posts: 487 PRO
    @Evan_Reese, being able to define a couple of cutter sizes like that (c1, c2, etc.) like you propose would certainly be helpful to me.
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    @matthew_stacy I mean you can already do that by using the feature a few times in a row with the "prepend names" option enabled. I could add it as an array parameter where you could add as many as you want in one feature, but the downside is that it wouldn't be configurable. Maybe that's worth the tradeoff? what do you think?


    Evan Reese
  • matthew_stacymatthew_stacy Member Posts: 487 PRO
    @Evan_Reese, running the feature multiple times should be fine for my needs.  I wouldn't mess with an array parameter at this point in time.
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    Ok, I'll hold off for now. Honestly I won't use the CNC option much. It will mostly be Injection for me, so if someone who does a lot of CNC work has suggestions to make the feature more helpful, I'm all ears.
    Evan Reese
  • matthew_stacymatthew_stacy Member Posts: 487 PRO
    @Evan_Reese???  How are the molds made for your injection molded parts?
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    @Evan_Reese???  How are the molds made for your injection molded parts?
    lol! point taken. I find that toolmakers are so much better at their craft than I am, that me trying to fully predict or dictate their process isn't always helpful, but can be needlessly limiting on the design. I don't know what endmills they want to use. I don't know whether they plan to use wire or plunge EDM techniques. I typically use my best judgment, make sure my parts can demold and shut off, and work with their feedback to get the rest of the way there. I'm always impressed by what they can pull off.
    Evan Reese
Sign In or Register to comment.