Skip to content
CAD & Design·Lesson 28 of 31

FeatureScript Automation for FRC

Read and write FeatureScript to automate repetitive FRC geometry, and assemble a custom-feature toolchain from the proven community scripts.

Sign in to track progress, earn XP, and save lessons.

FeatureScript is Onshape's programming language for building parametric features, and it is one of the biggest force multipliers for an advanced CAD team. Instead of clicking the same operations every part, you encode them once.

The mindset. FeatureScript is a typed language with math built for 3D (vectors, planes, transforms). You write features in the Feature Studio editor; the resulting custom feature appears in your toolbar like any built-in. The community has already written the FRC essentials — learn to use and read them before writing your own.

A toolchain of proven community FeatureScripts (from FRCDesign.org's curated list):

  • Origin Cube — first feature in every Part Studio; gives a consistent origin.
  • Tube Converter (Julia's FeatureScripts) — turns an extrusion into punched tube with presets for hole pattern, wall thickness, and profile, so 2x1 tubes match REV/AndyMark grids automatically.
  • Belt & Chain Gen — generates correct belts/chains from pulley/sprocket centers, eliminating wrong-length chain runs.
  • Robot Shaft / Robot Spacer (Alex's FeatureScripts) — generate hex/round shafts and spacers with retention options.
  • Part Lighten (2471's FeatureScripts) — parametric ribs/pockets.
  • Spur Gear — dimensionally honest gears for custom sectors.
  • Extrude Individual / 3D Printed Mass (Julia's FeatureScripts) — multi-part extrudes, and adjusting printed-part mass for real infill/wall.

Reading a FeatureScript. Open any of the above in the Feature Studio. You will see a FeatureScript <version>; header, import statements pulling in the standard library and geometry modules, then an annotation block that declares the feature's UI (the inputs that show in the dialog), and a function body that does opExtrude, opPattern, etc. Even without writing one, being able to read it tells you exactly what a feature does and why it might be misbehaving.

When to write your own. If your team repeats a non-trivial operation a configuration table can't capture — say, generating a bearing-bore-plus-retention-pattern keyed to a shaft-size enum — wrap it in a FeatureScript. Start by copying a simple community script, change its inputs and ops, and test on a throwaway part. Onshape's official FeatureScript documentation and the community-curated dcowden/featurescript list on GitHub are the canonical references.

Payoff: a team with a tuned FeatureScript toolbar produces manufacturable tubes, shafts, and lightened plates in a fraction of the clicks, and every part comes out consistent with the team's standards.

Key takeaways

  • FeatureScript encodes repeated geometry as reusable custom features; learn to read and use community scripts before writing your own
  • Assemble a standard toolbar: Origin Cube, Tube Converter, Belt & Chain Gen, Robot Shaft/Spacer, Part Lighten, Spur Gear, Extrude Individual, 3D Printed Mass
  • Write custom FeatureScript when logic exceeds what a configuration table can express; start by adapting an existing script

Lesson quiz

Required

Answer all 3 questions correctly to complete this lesson.

1.FeatureScript, Onshape's automation language, is most closely based on the syntax of which language?

2.What is notable about how Onshape's own built-in tools (like Extrude and Fillet) are implemented?

3.In FeatureScript, a custom feature type is defined as what, and edited in which environment?

Answer every question to submit.