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.
ThreadLab - Internal/External Modeled/Cosmetic Threads with External Thread Callouts
antlu65
Member Posts: 59 EDU
Custom Feature: ThreadLab V0.3
A simple custom feature for creating internal/external modeled/cosmetic threads on cylindrical faces. Dave Cowden's excellent ThreadCreator (I believe V3 is the latest version) has been used for years and is the de-facto standard for creating modeled threads, but has sometimes has significant feature regen time. Cosmetic thread implementation is based off of Sebastian Glanzner's Cosmetic Threads feature.
Features:
A simple custom feature for creating internal/external modeled/cosmetic threads on cylindrical faces. Dave Cowden's excellent ThreadCreator (I believe V3 is the latest version) has been used for years and is the de-facto standard for creating modeled threads, but has sometimes has significant feature regen time. Cosmetic thread implementation is based off of Sebastian Glanzner's Cosmetic Threads feature.
Features:
- Cosmetic or Modeled threads
- Thread profiles: ISO Metric, ANSI UTS, ISO Trapezoid (DIN 103), ANSI Acme, Whitworth
- Optional offsets
- Optional thread chamfer (lead-in)
- Customizable thread form
- Customizable thread name
- Created threads allow Hole Callouts in Drawing interface
- Multiple threads per feature invocation, fast feature regen time
- Thread fillets
- Tapered threads on conical faces (eg. NPT threads)
5
Comments
Your FeatureScript is really cool!
I like how you use the hole callout feature!
Do you think it is possible to automatically add the diameter of the core hole to the hole callout the drawing?
This icon confuses me.
At my opinion it indicates left handed thread because of the anti-clockwise arrow direction.
The showed thread in the model however is right handed, which should get a clockwise indication.
@Henk_de_Vlaam: Agree, using the orientation icon as I did was a poor choice - will change that.
Really appreciate your feedback!
I didn't realize you were the author of the Cosmetic Threads custom feature - that's the method I used for cosmetic threads in this script. Wanted to credit that here (and in original post). Thank you!
One thought: how about a middle ground "schematic" option? I.e. just a linear pattern of circular grooves instead of the full helix?
This can be a good intermediate that looks more "real" without incurring the high "cost" of swept helical cuts.
@eric_pesty: Thanks! And that's a cool idea - will think about adding that as well!
Thank you to for creating ThreadLab FeatureScript! I'm glad my cosmetic thread FeatureScript is useful to other Onshape users.
I hope that some day Onshape will implement a native way to display and model threads.
I also made another FeatureScript where you can change the level of detail of the external thread:
https://forum.onshape.com/discussion/16744/new-featurescript-external-thread-2d-3d
External Thread - FeatureScript:
https://cad.onshape.com/documents/190ed381cc4d7d3644e4459b/w/69776a82bab11838fe161502/e/dfca34f846d7250bee8c4f46
Internal Thread - FeatureScript::
https://cad.onshape.com/documents/41326316775b71b4c76d71c2/w/bdab4a37f9f548848e230c4d/e/113d4ba1dc7ffa295c02a7d3
I also have a third option to leave the face clean (no cosmetic or 3D thread). This is useful for me when I export step files:
In the "2D" option (cosmetic thread) I tried to simulate the thin line by revolute and cut away a thin rectangle.
This is useful for 2D drawings.
I really like your ThreadLab, because you have internal and external thread in one script and it is so cool how you used the hole callouts!
Thanks again for making this feature available. I finally got around to playing with it and it's awesome. No pressure to implement any of this if it doesn't make sense to you, but I do have a few thoughts that are mostly centered around my personal use-case for this feature which is 3D printing:
Very cool, thanks for linking these! I'll add a "Blank" option to leave selected faces unchanged.
"In the "2D" option (cosmetic thread) I tried to simulate the thin line by revolute and cut away a thin rectangle.
This is useful for 2D drawings."
If you get a chance, could you elaborate on this? I don't understand what this additional line is used for.
Really appreciate the feedback! Definitely helps identify poor assumptions I've made and helps me understand real workflows and use-cases. You make a great point emphasizing flexibility over hard restrictions on feature inputs - I'll make those changes and leave it for the user to decide.
"...I want to add my clearances to the male and female parts ahead of time, then add threads..."
Would it be useful if the feature gives the option of applying user-specified offsets to the selected faces - or do you prefer to enter them manually? Curious as to your preferred workflow. In any case, will remove the restriction on having selected faces be same diameter.
"I noticed the number of "Starts" on the acme thread is limited to 4"
Will remove this restriction.
"Since I'm creating threads to print and use, having a lead-in on them can be really helpful."
Could you link a simple example of this? I'm not familiar but would like to implement it.
If there's one thing I've learned in writing features I've written, it's that to maintain a simple enough feature, with a clear vision, you cannot accommodate everyone who has an idea or improvement request (that being me at the moment). If you think it makes sense, go for it, but I also won't feel bad if you don't think it's right for your feature. I'll make an example with a lead-in tomorrow sometime, and let you decide if it fits.
https://cad.onshape.com/documents/01860d68bcc294234ae3e65f/w/876191bbd7159797fe97f02b/e/165952b0d326f18bd1f57550
https://www.calqlata.com/productpages/00042-help.html
"If there's one thing I've learned in writing features I've written, it's that to maintain a simple enough feature, with a clear vision, you cannot accommodate everyone who has an idea or improvement request"
"When coding my own features, I have found myself getting myopic and trying to make one feature do too much, but it's important that custom features are designed to exist in the greater context of a whole chain of other features, instead of doing everything in one go. I try to stick to the single core purpose of the feature and let other features do some work too."
Sage advice - I am certainly guilty on these points! It's become obvious that I didn't have a clear vision for the feature before I set fingers to keyboard. The result appears to be a hammer in search of a nail.
Will release a new version that incorporates some of the earlier suggestions in this thread.
Link: ThreadLab
--------
* Flip manipulator for each selected face. User has finer control and is able to reverse thread direction on individual faces. Thought this was a cute feature, but not sure if it's more distracting than useful.
* Whitworth (rounded) preset thread profile. Rounded tip and root, with 55 degree included angle. Slower regen time than straight thread profiles.
* Option for thread chamfer / lead-in. User may adjust angle and radial distance of chamfer, feature will modify shaft and thread geometry accordingly.
* Option for offset on shaft and thread. User may specify offset distance for external and/or internal faces, feature will modify faces and threads accordingly. External offset will reduce shaft size, while internal offset will increase shaft size.
* Option for user-input thread name.
* Option for thread profile customization. User may specify thread angle, rounded/straight, and tip/root reduction factors.
* Removed restrictions on thread starts. Because it's a free country!
In terms of manipulators, you may wish to consider updating the flip logic so the base of the arrow is always at the start of the thread facing into the cylinder, as this behavior might be a little bit more intuitive to users/consistent with std manipulator styles.
I could also see a world where there isn't one manipulator for each face (akin to the onshape hole feature), but since you already have it (and even implemented query stabilization, which is awesome!), I don't really see any particular reason to remove it.
In any case, super great work - I'll definitely be recommending this to everyone I know as the new go-to way for making threads in Onshape.
The only thing I can find to complain about is that it would be nice to add some "imperial" data to the custom "lengthbounds". For example right now I added a chamfer in imperial units and it defaulted to 1" which was way too large and cause the feature to fail (until I noticed and changed it to .05).
https://cad.onshape.com/documents/6b640a407d78066bd5e41c7a/v/845d049782179b9faee8b6e6/e/c953720c264ce001f1a82dc1?jumpToIndex=1368
As a side note I don't know how much of the training you have gone through but even if you know how to use "CAD" in general it helps to actually go through the "basic" stuff as it goes over Onshape specific things like interface and how to do things like this (eg. add a custom feature to your toolbar)
I’m going to explain how I deal with threads in the hopes that this will explain my feature requests.
Here is an OnShape documument that helps explain the situation.
Non-modeled external threads
The built-in feature tool “External Thread” is what I want to use for the simple fact that is being supported by OnShape.
It requires that the cylinder diameter matches the thread’s outer diameter. So, for an M10 thread, the cylinder’s diameter should be 10mm. The External Thread sets up the model so that it appears on drawings, showing both the outer and inner diameters of the threaded area. The drawing’s Hole/Thread callout automatically displays the thread information on the drawing as well. This really is all that is needed to send a part to be manufactured by a machine shop.
Modeled external threads
Since all the thread information is already in the model, it would make sense if the thread geometry would be driven by that information.
If I change the thread pitch in “External thread” then the threads modeled would change as well.
I could then use the “Configuration panel” to define whether I wanted modeled threads or not (by suppressing ThreadLab). Using two configurations of the part in the same drawing, I could make something like this:
However, you will notice the callout created by ThreadLab 0.3 is inconsistent.
Requests for External threads in ThreadLab 0.3:
Non-modeled internal threads
The built-in feature tool “Hole” is what I want to use for the simple fact that is being supported by OnShape.
Select tapped and specify the thread, pitch, thread depth, hole bottom, and tap clearance. The Hole sets up the model so that it appears on drawings, showing both the outer and inner diameters of the threaded area. The drawing’s Hole/Thread callout automatically displays the thread information on the drawing as well. Specifically, drill an 8.8mm diameter hole, 5mm deep, and then thread it as M10x1.25. This really is all that is needed to send a part to be manufactured by a machine shop.
Modeled internal threads
Since all the thread information is already in the model, it would make sense if the thread geometry would be driven by that information.
If I change the thread pitch in “Hole” then the threads modeled would change as well.
I could then use the “Configuration panel” to define whether I wanted modeled threads or not (by suppressing ThreadLab). Using two configurations of the part in the same drawing, I could make something like this:
However, you will notice the callout created by ThreadLab 0.3 is incorrect, because it is driven by the diameter of the hole, and not the information added by the “Hole” feature.
Request for internal threads in ThreadLab 0.3:
- Add an option to be driven by the Hole data of
the part. This means the threading operation will remove material, not add it.
It also means performing partial threading based upon the configuration used to
make the Hole.
I hope I have been clear and maybe even compelling.