feature script
Discussion List
-
Best Way to create Hydraulic Hoses
Hi everyone, I'm looking for the best way (as of 2025) to model hydraulic hoses in Onshape for simple hydraulic assemblies. I already have a library of standard hydraulic components (see attached image), such as cylinders, pumps, valves, and fittings. What I'm missing is an efficient way to connect these components with…
-
Editing Hole Callout formula
Counterdrill hole (Countersink hole + Extra head clearance) is an option available in other CAD software, but doesn't seem to be an option with Onshape currently. I have cobbled together a feature script based on Hole feature that does the job geometrically, but the callout is as if it's just a Countersink hole. I'm…
-
How to Identify Faces Directly Created from Sketch Edges in an Extruded Part (FeatureScript)?
Hi everyone, I’m working with FeatureScript in Onshape and I have a question regarding extrusion operations. I’ve created a part by extruding a sketch, and now I need to identify which faces of the resulting solid are directly created from the edges of the sketch (i.e., the side faces that are the result of extruding the…
-
FeatureScript versions
I'm new to FeatureScript, but an experienced programmer familiar with many languages, but having trouble finding some specific useful documentation. I can't find proper information regarding the versions available for the version statement at the start of a script, and versions. The only references I've found show things…
-
Snap Hook Feature Script.. where is the groove??
Hi, new to Onshape. Trying to learn how to snap connect parts for 3D Printing I found the Feature Script called Snap Hook. It seems that it does only half a job. Where is the groove for the hook (cantilever)? Am I missing something? It would be really useful. Is there a second feature script for the groove? Kindly asking…
-
Error with extrude on point selection
So I just started feature script and was going through the lessons, however when I tried to do create a extrude on a sketch that I made on a point it failed However when I remove the extrude I can see the sketch so why doesn't this work? Here is the doc…
-
How to use function autocomplete?
I am trying to write my own functions with feature script. I want to use autocomplete the way the standard onshape functions do. The problem is I can't get it to work. I've been copying what I see in the standard library with no luck: Here's a dummy function with what I'm trying export function dummyFunction(id is Id)…
-
Get multiple vertices from a query
How would I go about getting multiple vertices from a query? I have a parameter that creates a query of 3 points. I am attempting to make a plane using the 3 points. Here is what I have so far: annotation {"Name" : "Points", "Filter" : (EntityType.VERTEX), "MaxNumberOfPicks" : 3} definition.points is Query; var points =…
-
Featurescript Boolean of Booleans not working
Hi! I am having trouble with booleans in featurescript when using the result of a boolean as a tool for another boolean. I have attached a simple example to explain my problem better. In this case, I generate 3 intersecting cylinders: I want to do a Boolean to combine the first two and then another Boolean to intersect the…
-
How to visualize cut features
Hey everyone, I'm working on a FeatureScript that cuts both a bolt hole and a nut slot in one feature, according to my specific needs. The feature itself is working great so far. What I am struggling with is: I am trying to figure out how to best visualize the hole that's being cut. Typically, most of the holes' geometry…
-
Feature script for filling in missing faces to fix faulty topology.
Hello, I want to create a feature script that let's me select bodies with missing faces (faulty topology), i.e. surfaces, and automatically have these missing faces filled. So far I came up with the following feature script:…
-
Script error i can't resolve please help. It's driving me nuts
here is my code. import(path:"onshape/std/standard.fs",version:"2581.0"); // Offset Skin FeatureScript for Xbox Controller (with Multiple Grip Patterns) // Creates an offset skin for an Xbox controller, allowing interactive // definition of the front face cut-out region and multiple grip patterns. export const xboxSkin =…
-
center path finder feature
Hi I have a problem with my script. I wrote a script that finds and adds the center path of a given body. So its the center between two given edge paths on the body as well. However I encountered an error and it didn't work, would appreciate any help! thanks. The blue body was created using a wiring feature. Wiring…
-
Changing lookup table reference from an ENUM
Hi All, I am creating a "simple" feature script which swaps the lookup table for a different size table (Metric / Imperial set sizes). I'm getting two issues which I hope are simple fixes but I can't seem to figure them out. Any help would be appreciated. I am getting a duplication error on the definition.sSize…
-
Change Material of Parts with Feature Studio
We have code that can update multiple material types at once. However, there's a bug in the software: if a material type is changed manually for an item, the code won't be able to update that item later. and If we try to change appearance with same code then it works fine. Is it an BUG ?! Here is code FeatureScript 2543;…
-
qCreatedBy(sketch_id, EntityType.EDGE) returns more edges than I drew
I drew a sketch with 11 edges, but qCreatedBy(sketch_id, EntityType.EDGE) returned 24 edges, and I parsed these edges and found that some of them were overlapping (all parameters were the same, except for deterministicId). Why is this happening? What are these "copied edges" used for?
-
Mounting Boss FeatureScript
Hello all, I've finally finished up this FeatureScript and thought some others may find it useful. It's for making different types of mounting bosses in plastic parts. These are used for adding screws to plastic enclosures, mounting circuit boards, etc... The script was based off of the Hardware Boss script by @NeilCooke.…
-
A question about CapType in Featurescript
There are three types about CapType: START, END, EITHER My question is: suppose a square sketch is extruded to form a cube, then the cube's edges have different CapType types. Is there a way in FeatureScript to trace the edges of a cube back to their originating edges or points in the sketch? For example: CapType:…
-
Is there a function in FeatureScript can perform operation `suppress`?
Hello everyone, my question is: Take chamfer as an example. Its operation is on some edges or faces. However, after the operation, the operated faces or edges will disappear, making it impossible for me to trace their information through transientId. In the main drawing page of onshape, the chamfer operation can be…
-
Please help me: `deterministicIds` DO NOT in ALL ids returned by `qeverything()`
I want to convert deterministicIds(in feature list) into query and then parse it. The conversion code is as follows: body = { "script": "function(context is Context, queries) { " " const _ = qEverything();" " const all_q = evaluateQuery(context, _);" " var target_q = -1;" " return transientQueriesToStrings(all_q);" " for…
-
how to use `queryString` in feature data?
I want to parse a CAD parameter data, including sketch, extrude, and chamfer, etc. I first got the feature data, and it seems that the queryString in it can help me get further information. But now I don’t know how to use queryString, can anyone help me? Thank you "featureType": "newSketch", "btType": "BTMSketch-151",…
-
Wood Grain Effect
Hi all. Simple question is the wood grain feature script available on the free licence version of Onshape. If so where can i find it please
-
Joining Tabs/Tags on Frames
Hi, Can anyone help me with trying to set up a feature script so that I can easily add in joining tab/tags to frames using either box section or angle. i have tried with the following code but keep getting errors. FeatureScript 1640; // Specify the FeatureScript version // Feature definition annotation { "Feature Type…
-
Are we able to return a Computed Suface Area of the Sheet Metal Top Side Only in FeatureScript?
I've been searching without luck to see if there is a FeatureScript that outputs into a custom table, the computed surface area of only the top or 'good side' of a flat sheet metal part on the flat? If not, is there a way to return this value in a FeatureScript that I'm not seeing? The basic evArea returns the entire…
-
Custom Frame FS without precondition
Does anyone know how to implement a custom frame in featurescript without using the precondition/UI? I found the FS for the frame tool in the std documentation that uses the UI, and I am wondering if it's possible to create a frame without it. For reference there was a post in here on Sept 4 about a custom Frame: FS Frame…
-
New Custom Feature: HAVF Profiles - Standard Airfoil Profiles
We are releasing an exciting new Custom Feature! Introducing HAVF Profiles, built in collaboration with Austin Holbrook and Greg Brown. This feature comes loaded with an extensive library of airfoil profiles, guaranteeing continuity at the leading edge and providing control over the core variables of the profile, such as…