-
Transform in "for" loop strange behavior
I've made a featurescript that spaces parts with an exact gap away from each other along a plane No mater what their shape or orientation (yes I am fishing for brownie points). HOWEVER! The last transform in the last loop seems to change it's vector despite the debug tool showing the vector is correct: var moveVector =…
-
Is it possible to set a minimum & maximum value for a sketch dimension ?
Using variables or otherwise, is it possible to set a minimum & maximum value for a sketch dimension ? Giving different values to some variables affecting the mentioned dimension, I want to be able to choose the value of that dimension and make sure that the result will stay between some defined limits. The link:…
-
Bill of Materials and FeatureScript
I'm using FeatureScript to create a pattern of a part. However, when assembled, these patterned parts aren't being recognized as identical in the BOM. This isn't necessarily a problem if I could configure the quantity property, but that isn't the case. I am aware I could add a custom part property and enter the quantity…
-
Pattern & Sweep (New Custom Feature!)
Pattern & Sweep (New Custom Feature!) https://cad.onshape.com/documents/76442daf92ce43df74883ec6/w/2f4ea4d52c5fb26051e11c55/e/d072106a68c04fc5d0a6862c How to add a custom feature to your toolbar:
-
Milk Crate FeatureScript Fundamentals Error
Today I was working through the Advanced Topics / Exercise: Milk Crate Capstone Project and I ran into an error I have been unable to solve. On Slide 12 of the tutorial it says to commit and test the feature, where you will be able to view the lattice in its correct position. I didn't receive an error, but the part never…
-
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:…
-
Custom features - 3d Points and Variable Pitch Helix
Original post: https://forum.onshape.com/discussion/25252/variable-pitch-helix-and-3d-point-fs-features-from-crusoe-technologies#latest Haven't received any feedback for our Custom features in 'General' category! So posting them to 'Featurescript' category and we are hoping to receive feedback from both regular Onshape…
-
The Meaning of 'startParam' and 'endParam' Parameters in Conic Sections
I would like to understand how startParam and endParam determine the start and end points of a conic section. As shown in the diagram, when defining a conic segment, we need three points: A (start), B (end), and C (control). Point M is the midpoint of AB, and the ratio MD/MC is equal to rho. When the conic is clipped, two…
-
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",…
-
I am trying to be able to select a complete curve automatically
I am currently in the process of adapting a feature script so that it is perfectly adapted to our requirements. Similar to the sweep feature. How can I implement it so that I simply select the created curve, or I select a part of the spline and all tangential edges are automatically selected? Currently I have to select…
-
Sheet metal flange using featurescript
Hi everyone! 😁 I'm working on creating a very basic flange on a square flat sheet metal part using FeatureScript. My goal is to eventually generate a 90° flange by selecting the edge of the sheet. I managed to achieve it by copy-pasting the entire code from the official standard library, but I’d like to know how to simply…
-
Sketch "Use" in featurescript
I cannot find the function to "Use (Project/Convert)" an existing face (which the feature user would define), onto a sketch that I create in my featurescript. Is it not implemented, or am I just failing at finding it?
-
New Custom Feature - Spiral
Spiral Link: https://cad.onshape.com/documents/abb998532f54a132a42bea8b/w/b0d311a0342c2b1e722bdaf1/e/79973a0f955c53b07d20e46e Created by: Michael Pascoe, Cache River Mill. References: Split helix surfaces - Andrew_Troup Transforms - Jake_Rosenfeld Wood Grain Texture - Tim Rice Standard Featurescript Library Source -…
-
Is it possible to get the length of all the outer edges of a face?
Hi everyone, I have a surface with a hole inside, and I'm interested in the total length of the outside contours (excluding the length of the edges around the hole). i.e. the length of all the selected edges in the example below. Is there a way to get this wihout having to select individual edges, but only the face?…
-
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…
-
Composite part design
Hi Onshape designers, I wonder if there's a feature script for designing composite parts (I'm not talking about the Onshape feature). Are any of you facing this challenge? Before embarking on the development of a specific feature script, I'd be curious to know how you manage to achieve multiple ply representations with…
-
Weird error table is still working perfectly
I'm getting this error when I use a Custom Table I made in anywhere that isn't the origonal document. Table is still showing up and everything seems to be working. I have no idea what it is but it's kind of annoying having the yellow excelamation mark whenever I open up the table. Typecheck canBeTableRow failed…
-
Custom Feature: Clone Curve to Points
Allows you to move or copy a 3D curve to a new location by defining the new endpoints. New curve retains the essential "Character" of the original curve but is stretched parallel to new Chord to reach target points. (Chord is a line between curve endpoints) User can also scale new curve normal to new Chord, and rotate new…
-
evCollision doesn't seem to work
I can't get all 8 "Clash type" results when clashing solid bodies. Here's what I can get: INTERFERE = Volumes and faces are intersecting ABUT_NO_CLASS = only faces are intersecting TOOL_IN_TARGET = only volumes intersect tool contained TARGET_IN_TOOL = only volumes intersect target contained NONE = ???????? EXISTS =…
-
Undocumented Hidden Featurescript
So far I have discovered: -opCreateOutline (creates flattened surace of input topology) -opExtractSurface (Used within opOffsetSurface) -?? notation for managing undefined variables -switch function All of which have no official documentation or any documentation what so ever. I also know that there is "Button"…
-
Beginner FeatureScript Help + Circular Pattern
Onshape Document: https://cad.onshape.com/documents/e14506ff4d20585b290e1eb9/w/f810b9cde10509e5ce6e5ed7/e/e9f37d1a61a2dd62e3b9d8fb After being interested in writing FeatureScripts but daunted by the task of learning it with zero coding experience whatsoever, I am knee deep in my first FS that isn't a step by step or hand…
-
Draw (New Custom Feature!)
Draw (New Custom Feature) https://cad.onshape.com/documents/bad94104a5ecdd5d422a7b40/w/ce1f9d49a79762d0e2431752/e/4fea5d9770def4e66ed79f03 Happy feature Friday! With this custom feature, you can create a spline (or polyline) and sweep by dragging the manipulator triad. If you like this feature, check out Freeform Spline by…
-
Triangular error icon in custom feature that is running correctly
Hey there, I've written a custom feature to rename bodies. The feature is working as intended, but often (sadly, not always) when I change features above this feature in the feature, I get this icon: The feature is still processing data correctly - the correct bodies are being assigned the correct names, the correct…
-
Sheet metal models and featurescript
Hello, We use feature script extensivley for running configurations. There are a few reasons for this, but essentially we can bypass assemblies, drive the configuration using strings rather than enums, and the configurations are typically much easier to maintain. In previous iterations of products we have done the…
-
Next number in part number scheme feature script
How can I modify my featurescript for an O-ring part studio to automatically generate next part number for each new configuration, following the in-built onshape numbering scheme? Currently, I have to manually enter the desired configuration in the properties and create a version within the part studio. I have read that…
-
Get part studio name within featurescript
Can you get part studio name within featurscript? Why? I'm using a CAM that allows importing of solids with metadata via a CSV file. In said file the first column must have the File path of the .x_t solids that it will import. Since conveniently onshape can export parasolid files with the part studio name - part name (a…
-
[Updated] Point pattern custom feature
Some time ago @cody_armstrong put together a great Point pattern custom feature. With the passing of a couple of years and nearly 1000 FeatureScript updates, today I published V2.0. Add to your toolbar: https://cad.onshape.com/documents/9fca78cb66a0bc83e359eb3e/v/401953fe6e5330bb77bf28ef/e/7052b96c07018ad97bbadbf9