Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_mcclary
Member, Developers Posts: 3,936 PRO
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
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
4
Comments
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
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)
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.
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.