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.
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.
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.