Galaxia Featurescripts

In honor of my team (hopefully) finally switching to Onshape, I’ve been working on some featurescripts to suit our CAD process. I thought I’d share them here for the community to use as well. Some of these are fully custom, some are forks of Julia’s featurescripts with modifications for our purposes. Big thanks to her for sharing that open-source resource with the community.

https://cad.onshape.com/documents/3872562361eef3fa28b83e84/w/7b238e20915affe58e64da2a/e/1dd6858929f0dacad2928c6b

Gearbox Plate Generator

Automatically generates a plate enclosing all of the selected circles. Removes the need to make a sketch with tangent lines connecting all of the components. Also allows for holes to be extruded (for bearings, motors, etc) and 5mm holes to be drilled (for bolts). Bounding circles are selected in order, either CW or CCW.

Hole

Replacement for the standard Onshape hole feature, which allows easier selection of metric standard bolt size holes. Unlike the standard hole feature, this can also drill the hole in both directions as opposed to needing two features, one for each direction.

image

Gusset Generator

Forked from Julia’s gusset featurescript. Adds two new modes: Autofill Lines and Colinear Holes. Colinear holes mode allows the user to make a non-convex L, T, or + shaped gusset without having to manually sketch out the intersecting lines. Select two sets of two holes and the script automatically generates the gusset around the holes.

Autofill lines mode removes our biggest issue: breaking when tube lengths/positions change. In this mode, instead of selecting the holes for the gusset, you select the lines and the hole spacing. The script places holes on the sketched lines at the given spacing, fills the existing holes in the tube, and replaces them with the matching gusset holes. When the tubes move/change, the sketch lines move accordingly and the gusset stays in the correct place. This disrupts the automatic hole pattern of the tube, but it doesn’t matter when you CNC all the tubes custom anyway.

Profile Converter

Forked from Julia’s tube converter featurescript. Separates configuration of thin and wide side hole patterns. Allows for selection of one, two, or three rows of holes on tube wide faces. Configurable hole size and spacing. Allows for option of even or odd number of holes (Julia’s script always uses an odd number). Exclude regions works on all parallel faces, not just the face the sketch is on. Modified to match team standards by default.

Shaft Generator

Forked from Julia’s shaft featurescript. Adds a round shaft option and removes a few types that we don’t use. Simplifies the shaft end constraint options (only tapped hole or snap ring) and separates the option to round each shaft end.

Spacer/Standoff Generator

Forked from Julia’s spacer featurescript. Creates our bolt spacers (10mm OD 8mm ID tube), standoffs (10mm OD stock), and shaft spacers (3D printed). Diameter not affected by selected circle size. Simplified to comply with team standards.

24 Likes

As a cheerful (depending on who you ask) continuation to the beginning of the last message we did end up switching over to Onshape :tada: and me being an experienced CAD team member that was very pro-switching, I wanted to take some initiative and start learning the ropes of making featurescripts in Onshape.

Out of the many things left to be “automated” with featurescripts, one of the few things left in my opinion was fasteners. Up to now, we had used a “template” document that @AriMB kindly made for us before our switch, which had almost all of the configurations for bolts nuts and washers that we used (since we’re an Israeli-based team we work with metric-sized fasteners). My goals with the featurescript were mainly:

  1. Create a featurescript that could make the bolt change length in-context (so that if parts had to change etc it would be easier)
  2. Make the bolt “round up” to the correct length in order to account for the nut and washer automatically (mainly based on the metric stock we have)

I ended up working a lot more than I expected on this, adding options to create a Nut and a Washer in the same feature, which could, if the user preferred, be merged with the bolt to create a single body (making it so less mates are required in the assembly).

link to FS document:

As a disclaimer, there are still some things left to be added like Flathead bolts (which we don’t use very often). Or things that I probably (:wink:) won’t add at all like hex-head bolts (We’ve rarely ever used them throughout all our years). There are a few measurements that I sort of “made up”, mainly amongst the non-simplified version of the nylock where I had no idea what radius of fillets to add, etc. Finally, this was my first ever “tackle” at featurescripts and my main sources of info were the Onshape forms and documentation (also lots of help from @AriMB ) so some things may still be bugged.

8 Likes

Thanks Ofri for writing about the new Bolt FeatureScript. I do want to note that we thought hard about whether it was worth it to have a custom part for each bolt instead of referencing a library document. On one hand, creating a new part each time can clog up an already full Part Studio. On the other hand, having the bolt length adjust automatically saves time, and combining all of the hardware into one part means fewer mates and replicates in the assembly. Our expectation is that the benefits will outweigh the drawbacks, especially considering our primary fasteners are rivets (not modeled) and bolts are less common. We’re going to try out this workflow as we make the switch to Onshape, and we’ll see how it goes.

 
I also want to write here about another new FeatureScript included in the same document, which is a fork of Julia’s Fillet All Edges. The biggest change is it allows you to select a single edge in order to fillet all of the edges in the connected loop. So in the example below, I selected one edge of the inner hole and all of the edges of that hole were filleted without touching the outside edges. Similarly you could select an outside edge to only fillet the outside edges and not the hole edges. Additionally, there are some minor quality of life improvements (like filtering out sketches so you don’t accidentally select the sketch edge instead of the part) and bug fixes (primarily relating to floating point equality).

4 Likes

Awesome

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.