Featurescripts
Onshape has its own scripting language to create custom features to automate aspects of design called Featurescript. There are a lot of featurescripts (what we call the custom features) that make designing for FRC much easier.
How To Install Featurescripts
- Open any Onshape document and go inside of a part studio
- Click the rightmost button on the toolbar
- Note: If you have previously added any Featurescripts one of those may show up as the right most icon. In that case click the dropdown to show the add button.
-
Paste the link of the document with the featurescript(s) in it into the search bar
- Note: Some of the below featurescripts exist in the same document, so you can add multiple from the same link.
-
Select the featurescript(s) you want to add to your profile, then exit the box. They will be accessible in all documents from then on in the same drop-down in the toolbar where you added the feature.
Video Tutorial
Adding Featurescripts while in a Featurescript Document
When viewing a tab in a document that uses custom features, you can click a button near the top left that says 'custom features'. From here you can add custom features used in the document to your profile.
Troubleshooting and Updating Featurescripts
If a featurescript is not working as expected, the current version might be broken. You might have to update the featurescript. If it needs updating, the feature will show a blue icon to the right of it that, when hovered over, will say "change version of linked document."
- The first way to update it is by individually by right clicking the feature you want updated in the feature list and clicking "Update linked document..."
- The second, and slightly more permanent way (until the maintainer of the custom feature creates a new version), is by right clicking any of the featurescript icons in your toolbar or in the custom features dropdown and clicking "Update..." or "Update all..." From there, you can see the current versions of the custom features you have added to your profile and update selected ones to use the current latest version when you use a featurescript.
Video Tutorial
List of Featurescripts
Tip
The title of each featurescript or group of featurescripts links to its respective document. Right click the title and click "copy link address" for installing it to your profile using the above process.
Highly Recommended
These featurescripts are must haves to enhance your Onshape workflow. Many of these are developed by members of the FRC community and well maintained.
- Used to create an origin reference for assembly mating
- Optionally import design constants like bolt hole sizes, heat set insert hole sizes, etc
- Optionally import functions for calculating gear OD, pulley/sprocket pitch & outer diameters, and calculate belt/chain c-c distances
- See Assembly Best Practices for more information on usage
Video Example
- Used in conjunction with Origin Cube FRC Functions to create highly customizable belts and chains
- Highly parametric - pulley/sprocket tooth count is automatically calculated from sketch pitch diameter.
- Create multi pulley, double sided belt, and multi sprocket transmissions with options for both toothed and round idlers
- Calculates belt and chain pitch; when used in conjunction with
Final
can allow for easy adjustment of path lengths - Block model and high detail belt and chain model options available
- Allows for arbitrary placement of belts with a mate connector reference
Video Example
Extrude Individual (Julia's Featurescripts)
- Can extrude multiple regions as different parts with one feature, even if regions are adjacent
- Commonly used with tube converter to make punched aluminum tubes from a top view sketch
Video Tutorial
Tube Converter (Julia's Featurescripts)
- Converts extrusions into punched tube, with customization and presets for hole pattern, wall thickness, and profile.
Video Tutorial
Shaft Generator (Julia's Featurescripts)
- Generates a shaft, with options for hex, rounded hex (13.75mm OD), MAXSpline, etc.
- Options for retention type on both ends
- Can be generated in-place and with offsets
Video Tutorial
Spacer Generator (Julia's Featurescripts)
- Generates a spacer, with options for round, 3/8" hex, and 1/2" hex
Video Tutorial
Part Lighten (2471 Featurescripts)
- Better than "Lighten" and more complex than "Vent"
- Better control over ribs, cut depth, fillets, etc.
- Gives a nice estimate of how much weight is being saved
Video Tutorial
FilletXpert (Fillet All Edges) (Julia's Featurescripts)
- After selecting a face, it adds a fillet to the corners of that face (all edges normal to the selected face)
Video Tutorial
Bundles
The below links contain several featurescripts each that you can add all at once. The more useful featurescripts from each bundle are demonstrated further below.
Structure
Extrude Individual (Julia's Featurescripts)
- Can extrude multiple regions as different parts with one feature, even if regions are adjacent
- Commonly used with tube converter to make punched aluminum tubes from a top view sketch
Video Tutorial
Tube Converter (Julia's Featurescripts)
- Converts extrusions into punched tube, with customization and presets for hole pattern, wall thickness, and profile.
Video Tutorial
Gusset Generator (Julia's Featurescripts)
- Generate a gusset from hole selections
- Warning: Not a very parametric featurescript and causes lag, but can be useful in a pinch
Shaft Generator (Julia's Featurescripts)
- Generates a shaft, with options for hex, rounded hex (13.75mm OD), MAXSpline, etc.
- Options for retention type on both ends
- Can be generated in-place and with offsets
Video Tutorial
Spacer Generator (Julia's Featurescripts)
- Generates a spacer, with options for round, 3/8" hex, and 1/2" hex
Video Tutorial
FilletXpert (Fillet All Edges) (Julia's Featurescripts)
- After selecting a face, it adds a fillet to the corners of that face (all edges normal to the selected face)
Video Tutorial
Robot Spacer (Alex's Featurescripts)
- A more complex alternative to Julia's spacer generator, if you need more config options
Electronics Mounting (Julia's Featurescri pts)
- Generates hole patterns for different electronic components using center points and mate connectors on sketches
MechSketch (TLamp's Featurescripts)
- Incredibly useful, generates sketch profiles for a variety of things
- Profiles for COTS parts like Maxspline, TTB inserts, maxtube, motors, and the versa patern
- Profiles and holes for all electronics
- Profile generator for pulleys and a spur gears
Power Transmissions
- Used in conjunction with Origin Cube FRC Functions to create highly customizable belts and chains
- Highly parametric - pulley/sprocket tooth count is automatically calculated from sketch pitch diameter.
- Create multi pulley, double sided belt, and multi sprocket transmissions with options for both toothed and round idlers
- Calculates belt and chain pitch; when used in conjunction with
Final
can allow for easy adjustment of path lengths - Block model and high detail belt and chain model options available
- Allows for arbitrary placement of belts with a mate connector reference
Video Example
Belt & Pulley Generation (2471 Featurescripts)
- Configurable belt and pulley generation
- Belt width, pulley tooth count, offset and fit adjustment, belt type, etc.
- Options for bore and flanges for both pulleys
- Generates GT2 pulleys
Sprocket (Abhi's Features & Configs)
- Generate a sprocket for common types of chain
- Calculates whether or not an inline chain tensioner will fit on a chain transmission
- For when you are too lazy to do basic math
Spur Gear (Alex's Featurescripts)
- Generates a spur gear with with many different options
- Can be useful for 3D-printed parts.
- Cuts a profile in a part at a given location and depth to fit a thriftybot insert into, for 3D-printed parts to stop them from stripping while being driven on an axle.
Polybelt Generator (2471 Featurescripts)
- Generates polycord and pulleys based off of selected points
Pocketing
Part Lighten (2471 Featurescripts)
- Better than "Lighten" and more complex than "Vent"
- Better control over ribs, cut depth, fillets, etc.
- Gives a nice estimate of how much weight is being saved
Video Tutorial
- Used for pocketing and lightening plates
- Uses sketch regions to determine pocket and rib placement
Video Tutorial
- Less optimized and breaks more then vent.
CheeseIt! (TLamp's Featurescripts)
- Advanced lightening pattern generation
- Isogrid, hexagon, or circle pattern
PatchIt! (TLamp's Featurescripts)
- Patches specified pockets in a part
Manufacturing
- Given some derived plates, either transformed from an in-context assembly (to maintain part count) or derived from a part studio, it will automatically lay them out into sheets of a given size, sorted by thickness. This is used to prepare a file to route or waterjet parts out of material with a machine.
- Creates a table of measurements
- Great for creating cut lists for parts
- Highly configurable featurescript that generates tab joints between overlapping parts
- Options to make it easier for cnc routers to cut parts
- Can use for bumper wood corners
- Features to make it easier for cnc routers to cut cavities in parts
Onshape Functionality Extensions
- Used to create an origin reference for assembly mating
- Optionally import design constants like bolt hole sizes, heat set insert hole sizes, etc
- Optionally import functions for calculating gear OD, pulley/sprocket pitch & outer diameters, and calculate belt/chain c-c distances
- See Assembly Best Practices for more information on usage
Video Example
- An extremely useful featurescript
- Creates variables from measured values
- Useful for creating parametric patterns, including hole patterns
- Adds reflected mate connectors to a part so you can easily mate it reflected across a plane in an assembly (does not mirror geometry).
- Give color to faces on a part retroactively
- Can use a variety of different color inputs
- Can be used for part color configurations
Set Materials (Abhi's Features & Configs)
- Parametrically set materials and appearances of parts in batches
Set Properties (Abhi's Features & Configs)
- Sets properties of parts in batches
2471's Part Numbering (2471 Featurescripts)
- Numbers parts based off of a given standard
- Used for quickly applying a system to number parts
3D Printed Mass (Julia's Featurescripts)
- Modifies 3D-printed parts to have accurate mass with given material, infill, and wall thickness
Video Tutorial
Advanced Variables (2471 Featurescripts)
- Can create a compound variable with path length, angle between edges, distance between planes, angle between planes, distance between points, pulley center distance, and chain center distance
- Very useful for complex belt and chain runs
- Include measurements that Onshape can't normally do