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.

Hole Wizard, but allows for variable input rather than pull down menu

john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
edited January 10 in FeatureScript
So I have always had to manually open every part and set the tap size per-feature when scaling a chute up/down or changing it from metric to standard bolts.

There always seems to be one tap hole I miss, or accidentally make fine thread.

When you only have 2 or 3 bolt sizes throughout a design, it would be nice to set some "common sizes" as variables and derive those variables into other part studios.
This is easy with clearance holes, but tapped holes that update on the drawing requires searching every part studio and playing with drop down menus.

I've been wanting this for a long time, now I think I finialy got it.


to do it, I made a hole and select all of the parameters

now view the code of the tab and find your hole specifications



Copy the hole.fs from the standard library source

now mess with the precondition to allow an isAnything(); input that will take our variable


Then, for each hole type, create an 'if else' statement at the beginning of the feature body
paste in the source from the partstudio tab and re-factor it like so:


at the end you may want to throw in a regenError in case the if condition is not met


Now you can standardize bolt sizes throughout an entire design by setting it in one place!

I'm sure someone way smarter than me in FS can find a way to use a lookuptable or import a bolt library from a .csv but I've already got all the fasteners I need for most projects already.
Let me know if there is a way to handle that.

Enjoy

Comments

  • Evan_ReeseEvan_Reese Member Posts: 1,424 PRO
    I'm not sure if I completely follow, but it seems pretty cool! I've been curious what clever stuff I can do by digging into my studio code.

    Are you going for something like the Variable Hole feature that @Alex_Kempen made? His lets you navigate the standard hole UI then saves the entire hole definition to an isAnything variable so future features can use identical hole settings in later features. You could also transfer it to other part studios with his Variable Library feature or Super Derive. Here's an example. Is that what you're going for?

    https://cad.onshape.com/documents/c74407192c308f19c2330688/w/055eabf391a3a4037d8762b2/e/47e1060e3bd518565f84a144
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
    Close,
    I wish I saw that before, would have found a way to make that work.

    In the end, I want a full parametric assembly, without configurations that is driven only from a single freaturescript.
    The feature will draw a "dumb model" for the quoter who is a non-cad user.
    It will update the quote drawing for her to export as PDF and DWG and STEP
    It will also create a cost report with labor hours and such for the quote

    It will also at the same time draw all the sheet-metal parts, assemblies, weldments, fasteners, purchased materials, part-nests for sheet-metal count, BOM

    here is a taste what that will look like, this is still in process, but all the proofs are there I think.
    This is in real-time, even with an odd bug that breaks a dimension (fix is to wiggle the dimension... I have a bug report out on this)

  • Evan_ReeseEvan_Reese Member Posts: 1,424 PRO
    Wow! that's some next-level automation going on there.

    I've never seen a dimension that failed but worked when you wiggle it. Do you think that could have something to do with copy/paste from the part studio code? (granted I'll need to look closer at the first post to see what you're doing). I think the positions of the sketch dimensions are defined there, and I wonder if you've given it an impossible or "undefined" location or something, and wiggling (or just moving it at all) it fixes it. Just a gut feel though. I don't know enough about how it works under the hood to know.

    When you've got it to a good place I hope you'll do another webinar about it or something. I'm sure I'd learn a lot.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
    No it's un related because it's modelud entirely out of the fs. Lou has a guess it may require a full regen that is only envoked after editing the sketch. I have to test it a bit yet
  • S1monS1mon Member Posts: 884 PRO
    @Evan_Reese

    Onshape uses the same D3 sketch solver as Solidworks. I've had countless sketches in Solidworks which would fail and then if you opened the sketch, and grabbed a point that was supposedly fully constrained, it would suddenly be ok. Nothing would move. It would just pop from being red to being black. Offsets of edges within sketches which then need to solve for an intersection seemed particularly brittle.

    Negative/positive dimensions are a huge challenge in CAD systems.

    It's been a while but I definitely had Solidworks models where every odd time you did a force rebuild it would fail, and ever even time it would be fine. Those are fun to try to fix.

  • Evan_ReeseEvan_Reese Member Posts: 1,424 PRO
    🤯 I've never observed that to my knowledge. wild!
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
    In sw, definitely i have seen some annoying stupid shit. This 'thankfully' has been a rare experience in Onshape. I will glady deal with this than spend 10 minutes in that mess
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
    edited January 13
    Not sure why everything went to Chinese though... 
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,693 PRO
    Is that karma or what?! 
Sign In or Register to comment.