Add Custom Features
Custom features (and custom tables) are written in a programming language called FeatureScript and are created in an Onshape tab called a Feature Studio. These custom features are able to be added to your Feature toolbar for use in documents to which you have write access. Custom tables are available immediately in the document in which they are created, and you can add them to any other document (from a version). See Custom Tables for more information on adding custom tables to Part Studios, and FeatureScript Custom Tables for information on creating custom tables in FeatureScript.
Add custom features to your Feature toolbar from any document to which you have a minimum permission set of “View, copy & export.” You can add custom features when you are in a Part Studio that you have write access to, or when you are viewing a version that contains the Feature Studio that defines the features.
- While in a Part Studio, click on the Feature toolbar.
- In the dialog, locate the document in which the desired custom feature is defined:
- FeatureScript samples - This filter lists all Onshape-supplied documents containing FeatureScript samples for you to try.
- Onshape standard filters - Use these filters as you do on the Documents page to locate a specific document.
- Search box - Enter the name of a document or paste the URL of a document containing FeatureScript (usually acquired through a Share action).
Custom features are linked from specific versions of other documents; the latest version is selected by default. If there is no version, you can request that the document owner (or someone with write access) create one.
- Clicking on any document name displays the custom features defined in it.
- Select the top level icon to insert all custom features inside it (each represented by its own icon on your toolbar), or select one feature.
The custom feature icon appears on the Feature toolbar.
To remove the custom feature before closing the dialog, select the custom feature in the dialog again. (This toggles the custom feature in and out of the toolbar.)
- If there is more than one version of the document, the latest version is displayed by default. Click to access the version graph and select a different version.
- Click the X in the upper-right corner of the dialog to close it.
The custom feature is now available for use on your Feature toolbar.
Use a custom feature
Using a custom feature creates a feature in the Part Studio Feature list, just like any other Onshape feature. Custom features linked to from another document are indicated in the Feature list by this icon .
Custom features behave like other Onshape features; they can be edited, suppressed, hidden, and deleted.
Update a custom feature
When a newer version of the document from which you inserted the custom feature is created, the link icon in the Feature list highlights in blue, and an identical icon appears on the Part Studio tab:
This is a notification only and no action is required.
To update the version of the custom feature being used:
- Click the update icon (or right-click the feature and select Update linked document) to access the Reference manager, in which you are able to choose update options.
- To update to the latest version, click Update all.
- To update to a specific version:
- Click Selective update:
- Select the document (if there is more than one) and click for that document:
- Select the version to update to.
- Repeat for any other documents in the list, if necessary.
- Click Update selected.
If a feature in a user's Feature list corresponds to a tool added by the admin, the feature will not show as out-of-date (even if the tool is) but if it is not from the same version as the tool it will show as out-of-sync .
The Reference manager Update all command updates out-of-sync features to the version in the toolbar, even if that version is lower than the latest version or lower than the version the feature is currently from. A user can click the icon and use the Update command to update the tool:
Remove a custom feature
To remove a custom feature from your toolbar, right-click the icon in the toolbar and select Remove.
The custom feature will no longer appear in the toolbar when editing Part Studios, unless that feature had been used and exists in the Feature list. If the Feature list contains a custom feature, and your toolbar does not have a corresponding custom feature icon (either because it was removed or the document was shared with you and your toolbar never contained the icon), the Linked custom features in this Part Studio icon appears in the toolbar and the custom feature is available from the dropdown:
This allows users with access to that Part Studio to continue to use that custom feature.
Open the document of a linked custom feature
To re-familiarize yourself with a custom feature in your document and how it works, right-click the custom feature icon in the toolbar and select Open linked document. The document containing the custom feature’s Feature Studio opens in another tab.
If you have written your own custom feature in this workspace, the custom features defined in it are automatically available for use from the Custom features drop down in the Feature toolbar:
- Click the icon to list all custom features defined in the workspace:
- Select the custom feature to use.
Custom features from the current workspace automatically update when the FeatureScript that defines the feature is edited and committed. This is useful for quickly testing when developing custom features.
Share a custom feature
To make your custom features available to others:
- Create a version of the document containing the custom feature FeatureScript.
- Either:
- Share the document with specific individuals or teams, specifying at least “Can view, copy & export” permissions.
- Make the document public.
A custom feature icon is specified by uploading the icon as an SVG blog tab in the document, and then referencing it. For more information, see the instructions in Custom Icons in the FeatureScript documentation.
A description image is a picture of the feature output and is specified by uploading the image as an SVG blog tab in the document, and then referencing it. For more information, see the instructions in Custom Icons in the FeatureScript documentation.
If you have a Document that contains a custom feature you would like to publish and make available to the public, you can do so when you create a new version of the Document or directly from the version's context menu in the Versions and history panel. This also makes it easier to search for Documents that contain public custom features.
-
Create a public Document that contains the custom feature in a Feature Studio tab. See Add custom feature for more information.
-
In the same Document, click the Insert new tab icon () and create a Part Studio that uses the custom feature.
-
In the same Document, click the Insert new tab icon () and click Import. Locate and import a PDF file. Typically this is an instructional document that explains the custom feature.
-
Click the Versions and history icon () to open the Versions and history panel.
-
Click the Create version icon() to open the Create version dialog.
-
Provide a Name and Description.
-
Click the Publish custom features and tables option. If there are any errors with your Document's FeatureScript, they appear with a red x icon () to the left of their explanation in the checklist. A checkmark icon () indicates publishing requirements are met.
-
Click Create and publish or Create version, publish, and edit properties to create the version and publish the custom features and tables simultaneously.
The Publish custom features and tables option is displayed only if the document contains a Feature Studio tab.
Custom features must also have a description (this is different than the Description field in the above dialog). See Feature UI: Description in the FeatureScript documentation for more information.
If you do not use the Publish custom features and tables option in the Create version dialog, you can Publish after the fact by right-clicking on the Version (V1 in the example below) and selecting Publish FeatureScript from the context menu:
If a Document version contains a published custom feature, the bracket indicator ({}) is displayed around the version node in the Versions and history graph:
To unpublish a custom feature, right-click on the version and select Unpublish FeatureScript from the context menu:
To search for published custom features:
-
From the Documents page, select the Public filter along the left side panel.
-
In the Search field at the top of the screen, click the dropdown arrow on the right.
-
Click the Add criteria dropdown and select Published FeatureScript:
-
Select True to filter all documents with published FeatureScript or False to exclude all documents with published FeatureScript:
-
Click Search. Results are displayed below.
- Onshape automatically lists custom features alphabetically.
- If you choose to update to a version that is not the latest, the ‘out of date’ icon remains.
- Updating the referenced version of a custom feature does not change the version of the custom feature pointed to by your toolbar. To update the version pointed to by the toolbar, remove the existing icon and add a new custom feature that points to the newer version.
- After updating a custom feature, you may have to edit the feature for it to regenerate without errors (for example, with the addition of fields that require input).
- Once you have used a linked custom feature in your document, you have access to it even if the source document is deleted or unshared.
- Adding custom features to your toolbar is an account setting and not a document setting. The icon (and associated custom feature) is available in all of your documents.
- Adding a custom feature to your toolbar (or opening a document containing a custom feature) automatically turns on the FeatureScript notices, indicated by in the Navigation bar. These notices provide feedback that may be useful to the developer of the custom feature.
FeatureScript has been designed with security in mind. To protect you, FeatureScript runs in a tight sandbox and limits the impact of the feature to the Part Studio in which it is used. This ensures that using custom features written even by untrusted users is relatively safe.
A custom feature cannot:
- Modify anything other than the Part Studio in which it is used.
- “Infect” your Onshape account in any way.
- Communicate anything back to its author or anyone else.
- Affect Part Studio regeneration after it is removed from the Feature list.
- Modify other features in the Feature list.
A malicious (or poorly written) custom feature may:
- Take a long time to regenerate, or otherwise consume excessive resources, interfering with your ability to work with the Part Studio until you remove the custom feature.
- Modify variable values or geometry in the Part Studio in an attempt to cause harm.
Publishing malicious FeatureScript is against the Onshape Terms of Use and will not be tolerated.
Please report malicious custom features using the Feedback button in the Help menu.
Add custom features to your Feature toolbar from any document to which you have a minimum permission set of Link document. You can add custom features when you are in a Part Studio to which you have edit access or when you are viewing a version that contains the Feature Studio that defines the features.
- Tap on the Add custom features icon.
The Add custom features panel opens.
- Tap to select between current workspace and browse documents.
- Tap to select a document from which to add a custom feature.
- Tap to select the version of the document.
- Tap to select the custom feature you wish to add.
Tap a drop down to select all of the custom features within it or tap individual custom features.
The added custom feature is highlighted in blue in the panel and it is added to your feature toolbar.
- Tap the checkmark to close the panel.
Onshape automatically lists custom features alphabetically.
Custom features linked to from another document are indicated in the Feature list by a link icon.
When a newer version of the document from which you inserted the custom feature is created, the link icon in the Feature list highlights in blue, and an identical icon appears on the Part Studio tab.
See
Linked documents
for more information on linked documents and how to update them.
Remove a custom feature from your feature toolbar
- Tap Manage in the lower right of your feature toolbar.
- Tap the x next to the custom feature you wish to remove.
- Tap Done when you are done managing the custom features.
FeatureScript has been designed with security in mind. To protect you, FeatureScript runs in a tight sandbox and limits the impact of the feature to the Part Studio in which it is used. This ensures that using custom features written even by untrusted users is relatively safe.
A custom feature cannot:
- Modify anything other than the Part Studio in which it is used.
- Infect your Onshape account in any way.
- Communicate anything back to its author or anyone else.
- Affect Part Studio regeneration after it is removed from the Feature list.
- Modify other features in the Feature list.
A malicious (or poorly written) custom feature may:
- Take a long time to regenerate, or otherwise consume excessive resources, interfering with your ability to work with the Part Studio until you remove the custom feature.
- Modify variable values or geometry in the Part Studio in an attempt to cause harm.
Publishing malicious FeatureScript is against the Onshape Terms of Use and will not be tolerated.
Please report malicious custom features using the Contact Support button in the Help menu.
You must add a custom feature to the Feature toolbar using Onshape on a browser before you are able to access it on a mobile device. See the Onshape Browser Help topic Custom Feature for more info.
On a mobile device in a Part Studio:
- Tap the Features icon to access the Feature toolbar.
The custom feature added using Onshape on a browser, is available in the Feature toolbar on your mobile device.
- Tap to use the custom feature.
- Complete the dialog and tap the checkmark.
- The custom feature that has been used is listed in the Feature list, just like any other Onshape feature.
Custom features behave like other Onshape features; they are able to be edited, suppressed, hidden, and deleted.
Custom features linked to from another document are indicated in the Feature list by a link icon.
When a newer version of the document from which you inserted the custom feature is created, the link icon in the Feature list highlights in blue, and an identical icon appears on the Part Studio tab.
See
Linking Documents
for more information on linked documents and how to update them.
FeatureScript has been designed with security in mind. To protect you, FeatureScript runs in a tight sandbox and limits the impact of the feature to the Part Studio in which it is used. This ensures that using custom features written even by untrusted users is relatively safe.
A custom feature does not have the ability to:
- Modify anything other than the Part Studio in which it is used.
- Infect your Onshape account in any way.
- Communicate anything back to its author or anyone else.
- Affect Part Studio regeneration after it is removed from the Feature list.
- Modify other features in the Feature list.
A malicious (or poorly written) custom feature may:
- Take a long time to regenerate, or otherwise consume excessive resources, interfering with your ability to work with the Part Studio until you remove the custom feature.
- Modify variable values or geometry in the Part Studio in an attempt to cause harm.
Publishing malicious FeatureScript is against the Onshape Terms of Use and will not be tolerated.
Please report malicious custom features using the Contact Support button in the Help menu.