Alex Kempen’s FeatureScript Documentation¶

Welcome to the documentation site for all of my FeatureScripts. FeatureScripts are powerful design tools which can be used to simply or automate many aspects of design in Onshape.
To learn how to install and use FeatureScripts, see Getting Started.
Getting Started¶
Note
FeatureScripts are only available inside Onshape part studios - not assemblies or drawings.
Steps for adding FeatureScripts to your toolbar¶
Open any Onshape document, then open any part studio you can edit.
Open your FeatureScript dropdown by clicking on
in the rightmost part of your toolbar.
Choose Add custom features to open the Add custom features menu.
Paste a link to an Onshape document containing one or more FeatureScripts into the top search bar of the Add custom features menu.
Click the document which appears.
A list of one or more feature studios should appear. Click each desired FeatureScript to add it to your FeatureScript dropdown, which will cause it to turn blue.
Click
to close the Add custom features menu.
Tip
Once a FeatureScript has been added to your FeatureScript dropdown, you will be able to use it in every part studio you open.
Steps for using FeatureScripts¶
Robotics FeatureScripts¶
FRC belt calculator¶

The FRC belt calculator feature allows users to quickly add belt and pulley assemblies to a part studio. Belts may be either GT2 or HTD, and configurable 3D printable pulleys may also be added.
The FRC belt calculator FeatureScript can be found here: FRC belt calculator document
Steps for creating belt runs¶
Create an FRC belt calculator feature by selecting it from your FeatureScript dropdown.
In the Position tab:
Specify a Pulley one position and a Pulley two position to use.
If desired, specify an Offset location (Center, Pulley one, or Pulley two) and a Offset for your belt run, and use
to reverse the direction of the Offset.
- ..note ::
If you set the Offset location to Pulley one or Pulley two before adding a corresponding Custom pulley in the Pulleys tab, the Offset will be applied from the middle of the belt run.
In the Belt tab:
Specify your desired belt standard (9mm wide GT2, 9mm wide HTD, or 15mm wide HTD).
Choose whether you’d like to automatically choose the belt size (Auto choose belt) based on the computed center to center distance (as determined by the distance between your desired Pulley positions, the teeth of Pulley one and Pulley two, and the Center to center adjustment).
Specify a supplier inventory you’d like the belt to be chosen from, or choose Any belt size to choose from any available tooth count.
If you’ve chosen to size the belt manually, enter the desired number of Belt teeth.
Choose whether to Enable belt teeth in order to also create an approximate tooth representation.
If desired, specify a Center to center adjustment to modify the standard belt center to center distance.
In the Pulleys tab:
Specify the configurations of Pulley one and Pulley two:
Specify whether you’d like to create a 3D printable Custom pulley or No pulley.
Enter the number of Pulley teeth.
If you’ve chosen Custom pulley, specify:
The Pulley width
The Bore type (Hex, Circular, VEXpro spline, or None)
The Bore diameter
Whether to Enable flanges
The Flange width (if flanges are enabled)
The Pulley teeth size adjustment
Choose whether to create the belt run as a single composite part (Create composite part).
Note
Creating a belt run as a single composite part can help simplfy the assembly process later on.
Center distance checks¶
When both pulley positions are defined in the Position tab, the FRC belt calculator FeatureScript will automatically measure the distance between the selected positions and report a warning if the distance between the belts does not match the center to center distance of the belt run.
Note
The belt center to center distance is determined by the number of Belt teeth, the teeth of Pulley one and Pulley two, and the Center to center adjustment.

To correct a belt center to center distance error, change the distance between your Pulley one position and Pulley two position selections to match the value displayed in the error tooltip.
Tip
The error tooltip can be seen at the top of the screen while the FRC belt calculator feature is being edited, or by mousing over a broken FRC belt calculator feature in the feature tree.

Plate¶
The Plate FeatureScript can be found here: Plate document
Warning
The latest version of the Plate FeatureScript is still experimental. Thus, there are a few known issues and other bugs associated with it, and it may behave improperly in certain situations.
General Purpose FeatureScripts¶
These FeatureScripts have functionality which are applicable to a wide purpose audience.
Point derive¶
The Point derive feature is a powerful variant of the Onshape Derive feature which allows users to specify locations when deriving parts. Point derive also automatically converts mate connectors attached to parts which are being derived into selectable points, making it easy to derive and use standard components.
Note
Parts don’t need to have mate connectors attatched to them to be used with Point derive.
The Point derive FeatureScript can be found here: Point derive document
Steps for deriving entities¶
Create a Point derive feature by selecting it from your FeatureScript dropdown.
Specify Entities to import.
If desired, select one or more Locations to place the selected entities at by clicking sketch vertices or mate connectors in the graphics window.
If the derived part has any mate connectors, they will automatically be instantiated as selectable points in the graphics window. Choose the appropriate point to use by clicking on it.
Note
If your selections to derive don’t have any attatched mate connectors, no selectable points will appear.
Choose whether to Move derived entities relative to their respective Locations.
Choose whether to Delete planes and sketches from Entities to import.
Choose whether to Delete mate connectors from Entities to import.
If desired, specify a part boolean operation (Add, Remove, or Intersect) and select a Merge scope (or choose Merge with all) to boolean parts in Entities to import to existing parts in the part studio.

Tips for setting up parts to be derived with point derive¶
Tip
The orientation of mate connectors relative to one another is maintained.
The first mate connector in the feature list of the derived part studio serves as the default selected point.
Mate connectors do not have to touch derived entities to be used as selectable points.
Edge derive¶

Edge derive makes it possible to quickly derive length-specific parts into a part studio. Mate connectors attatched to derived parts are automatically converted into selectable points, and various positioning options are also avaialable by default.
The Edge derive FeatureScript can be found here: Edge derive document
Steps for deriving entities¶
Create a Edge derive feature by selecting it from your FeatureScript dropdown.
Specify Entities to import.
Select one or more edges to derive parts along.
For each selected edge, a set of manipulators are automatically created in the graphics window which enable positioning.

Choose whether to Move parts relative to their reference edges.
Choose whether to Delete planes and sketches from Entities to import.

Steps for setting up parts to be derived with edge derive¶
Create a new part studio.
In the Configuration panel on the right side of the screen, add a Confirguation variable named “length” (lowercase ‘l’).
Use the configuration to drive the length of your part.
If desired, add one or more mate connectors with their z-axis facing upwards to the middle of the part. When the part is derived using Edge derive, these mate connectors will be converted into selectable points.
Add additional configurations and modifications to the part studio as desired.

Note
A sample part studio can also be found here: Edge derive example part studio
Assembly mirror¶
Assembly mirror facilitates the assembly of parts by adding mate connectors to parts which allow instances of those parts to be quickly placed in mirrored positions in assemblies.
Important
Since FeatureScripts cannot be used directly in assemblies, the Assembly mirror feature cannot create transformed copies of parts directly inside assemblies. Instead, the Assembly mirror feature works by adding mate connectors to parts inside part studios which allow copies of those parts to be assembled into mirrored positions later on.
The Assembly mirror FeatureScript can be found here: Assembly mirror document
Steps for creating mirrored parts¶
Create an Assembly mirror feature by selecting it from your FeatureScript dropdown.
Specify your desired result behavior (Part center or Origin).
See also
Result behavior for more information.
Select one or more Entities (parts or surfaces) to find transforms for.
Select a Mirror plane to mirror about.
The Assembly mirror feature will automatically try each possible transform type (Linear, Z axis, Y axis, X axis, and Mirror) for each part and select the one that matches a part to its mirror image.
If a valid transform is found, the transform type of the part will be updated with the valid transform, a mirror image of the part will be shown in blue in the graphics window, and a mate connector which can be used to assemble the part in the location of its mirror image will be created.
![]()
Otherwise, the transform type of the part will be changed to Mirror, and a mirrored copy of the part will be created.
Warning
Since Assembly mirror cannot compute surface transform types automatically, the transform type of surfaces will always default to Mirror and will need to be changed manually.
Note
The transform type will only be computed automatically when a feature is first selected. If you make changes to the part later on, you may need to reselect the part or update the transform type manually.
Choose whether to Add prefix and suffix to the mirrored versions of entities.
If Add prefix and suffix is selected and the name of the part is changed, the name of the mirrored part may not update to match the change. This can be fixed by selecting Update saved names, and then Confirm, to update the internally saved names of every part

Steps for creating mirrored parts using preselections¶
Before creating an Assembly mirror feature:
Pre-select a Mirror plane and one or more Entities to mirror by either:
Selecting parts and planes directly from the feature tree or parts list
Selecting geometry (edges, faces, or vertices) in the graphics window which touch the entities you’d like to use
Create an Assembly mirror feature by selecting it from your FeatureScript dropdown.
The Entities and Mirror plane parameters are filled in automatically according to your preselections.
Specify additional parameters as needed.
Tip
Several native Onshape features also support preselections. For example, the Onshape Plane feature will automatically switch to Line angle mode if you select a plane and a line prior to creating the feature.
Result behavior¶
Assembly mirror offers two options for locating mirrored parts; Part center and Origin.
Part center: Mate connectors are created such that entity mirrors are aligned when their center mate connectors are fastened together.
Origin: Mate connectors are located relative to the world origin, so mirrors are aligned when their mate connectors are fastened to the part studio origin. To assist with this, care should be taken that the assembly origin matches the part studio origin.
Tip
When using Origin, make assembling faster and more robust by createing a mate connector at the assembly origin and selecting it via the Mate Features list.
Variable library¶
The Variable library feature makes it possible to create and use global variables in Onshape by storing variables on cube parts. Variables may also have associated descriptions which can be viewed via a custom table.
The Variable library FeatureScript can be found here: Variable library suite document
Steps for using variable libraries¶
Create a Variable library feature in a part studio.
Set the Variable library useage behavior to Use.
Click Select Part Studio…, then navigate to another part studio containing one or more library variable cubes and select them.
The variables attatched to those parts are automatically added to the part studio.

Steps for creating variable libraries manually¶
Create a Variable Library feature in a part studio.
Set the Variable library usage behavior to Create.
Set the library creation type to Manual.
Add one or more variables. A library cube part is created containing each added variable.
If desired, choose Add descriptions, then add descriptions to each variable in Variables.
See also
Variable descriptions for more information.

Steps for creating variable libraries from existing variables¶
Note
It isn’t currently possible to add custom variable descriptions when creating variable libraries this way.
Create a Variable library feature in a part studio with one or more existing variables.
Set the Variable library usage behavior to Create.
Set the library creation type to Automatic.
Specify a Library name.
A library cube part is created containing all of the variables currently visible to the variable library feature.

Steps for creating variable libraries from CSV files¶
Open the Variable Library Template, make a copy, and then edit the template as desired.
The Variable Library Template can be found here: Variable Library Template

Note
Keep in mind the following while adding variables: * An arbitrary amount of libraries may be created. * Variable names must start with a single letter, followed by letters, numbers, and underscores (_). Spaces and other special characters are not allowed. * Variable units must parse to a valid Onshape unit abbreviation like in, inch, deg, or degree. Punctuation and capitalization is ignored.
AFter you’ve finished editing, download the template file as a .csv (Comma Seperated Values) file, then upload it into Onshape.
Create a Variable library feature in a part studio in the same document as your uploaded CSV file.
Set the Variable library usage behavior to Create.
Set the library creation type to Import.
Select the CSV file you uploaded to Onshape.
If your CSV file has a top-level header row, select Skip first row.
The variable library feature should add one or more variable library cube parts to the part studio.
Variable descriptions¶
Descriptions can be added to manually created variables and to variables imported from CSV files. These descriptions can then be seen later on using a custom table.
To add and use the variable library custom table, you will need to first add it to your custom table tab.
Open the Custom tables panel by clicking on the corresponding button on the far right side of your screen.

Choose Add custom tables, then copy and paste the following link into the search bar:
Open the resulting document and click Library variables to add it to your custom tables.
Variables in your part studio which have been created by the library variable feature are displayed in a table format (along with their description, if added).
Glossary¶
- Graphics window¶
The graphics window refers to the model window, where parts, sketches, and other entities can be seen and interacted with.
- Editing logic¶
Editing logic is a feature of some FeatureScripts which enables certain parameters to update dynamically as a user is creating or making changes to a feature. For example, creating an extrude which hits another part will result in the boolean operation of the extrude feature being set to Add, and the other part being added to the Merge scope.
- Feature¶
A feature is a modeling tool which exists in part studios. Features are listed in the Feature list on the left side of your screen, and can represent an instance of a custom FeatureScript feature or a native Onshape feature (like the Onshape extrude feature).
- Feature dialog¶
The term feature dialog refers to the menu that is shown when creating or editing a feature.
- Feature tree¶
The list of features in a part studio which can be found on the left side of your screen.
- Parts list¶
The list of all parts in a part studio. The parts list exists in the bottom left of your screen, underneath the feature tree.
- FeatureScript dropdown¶
Your FeatureScript fropdown is a section of your part studio toolbar which is reserved for custom features you’ve added there.
- Manipulators¶
Manipulators are a feature of some FeatureScripts which enable users to modify the behavior of features via selectable arrows and points in the graphics window.
- Preselections¶
Preselections are a feature of some FeatureScripts which allow certain entities to be selected before a feature is created. For example, a plane and a line can be selected before creating a Construction plane feature to change the plane creation mode to Line angle automatically.
About Me¶

Hello! My name is Alex Kempen. I’m a sophomore college student at the University of Texas at Dallas majoring in Computer Science.
I’m also a mentor of FRC Team 1745. If you ever have a competition with us, feel free to stop by and say hi.
If you have any questions, comments, concerns, or feedback about any of my FeatureScripts or other work, feel free to reach out to me through one of the following methods.
Email: Alex.Kempen@utdallas.edu
Onshape Forums: Alex_Kempen
Chief Delphi: VenomousFire