featurescript
Discussion List
-
Query sheet metal bend / flange center line
Hello there ! I'd like to measure the distance between a hole axis and my sheet metal bend center line (the dotted line inside the sheet metal flat view), but i'm having a hard time querying it I did managed to do a "manual" query of the center line ike so : annotation { "Name" : "Center line", "Filter" : EntityType.BODY…
-
How to getAllVariables() in defineFeature.precondition?
In a defineFeature, I would like to list all variables in the precondition. Here is my code: FeatureScript 2559; import(path : "onshape/std/common.fs", version : "2559.0"); annotation { "Feature Type Name" : "Set Variable", "Feature Type Description" : "" } export const myFeature = defineFeature(function(context is…
-
feature identity/selection stability with parametrized models
https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/85b86a9ace50715ca6716cea/e/28794b8e69f77c9e0f3125ad In insert_unit I have a single square unit I use elsewhere. In bin I use my featurescript to instantiate a grid of these based on x and y count parametrization. In the script the grid of instances are booleaned…
-
Laser Joint Updated to V3.0: Pin Face Offset and Pin Chamfer!
Direct link to the new version here. Pin end faces can be offset either in or out; convex pin edges can be chamfered to aid insertion. End face offset as requested by @Hugh_Goodbody, @michael3424, and @brucebartlett. Notes: Performance on joints with no options is the same; pin face identification is currently the most…
-
Changing feature parameters when onshape won't load because regen time
I'm running into a problem on a custom feature I'm developing. Part of the feature is calculation intense, and uses a pattern operation to generate many copies of a body. The number is settable through a parameter, which means it is possible to enter a value that makes the regen time be unreasonably long. I imagine this…
-
Extrude separate adjacent shapes
Does anyone know of a way to extrude two or more adjacent sketch outlines as separate objects? I often need to do this and wind up making several separate extrude features, but it would be much quicker and simpler if there was a featurescript or something that would do it in one operation.
-
mates showing in part studio not present when in assembly
https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/c7ea79f0a01fbb55a00bce3f/e/fd67035c9e5e62f496ede719 I am exploring and learning about both derive and featurescript here. In each of the part studios base_unit and insert_unit I create a mate connector. I use my featurescript with an instantiator to create a…
-
having trouble with setting configurations for `addInstance()`
var instance = addInstance( instantiator, baseUnitStudio::build, { "configuration" : { "is_left" : false }, "transform" : transform(vector(x * definition.xd, y * definition.yd, 0 * inch)) } ); https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/cbf25e31bb40ade74e9aa036/e/9cbee39ae72c63645cafbc53 I am attempting to…
-
Transforming a sketch into straight vertical and horizontal lines for 3D printing
Hi! This is my first post here. The problem I want to solve is that if you 3d print something small, it matters where the slicer places the outer layers. When drawing a sketch, you don't know where the edges of the layers will appear. That's why I'm trying to make a new feature that allows you to copy and transform a…
-
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…
-
Nesting Sheet Metal parts in Drawing
Is there a tool or featurescript that allows to nest a bunch of flat sheet metal parts to one Drawing or Sketch? To export to DXF. I need to laser-cut many parts in one go. Preferrably nicely packed together. Now I manually place them in a drawing, but that is too painful, as the parts are also subject to change based on…
-
Optimization Solver - New Feature on fs.place
I've gotten a number of request over the years for features that have a measurement based constraint such as perimeter or area. The topic has also come up on the forums a few times (https://forum.onshape.com/discussion/18610/how-can-i-use-perimeter-as-a-constraint). My answer to the question has always been - to optimize a…
-
A question about B-Spline to Interpolated-Spline
I’d like to ask if there is a way to convert a B-Spline (defined by control points, knots, etc.) into an Interpolated-Spline (defined solely by a series of points, similar to the spline in Onshape UI). The evCurveDefinition function returns the parameters of the B-spline (control points, knots, etc.), but the parameters I…
-
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?
-
Hey FeatureScripters - What would you like to see in an advanced FeatureScript tutorial?
Hey everyone, I'm Josh, one of the Part Studio developers. Recently I decided the community could use a more advanced tutorial to cover some of the trickier topics in FeatureScript: Queries, ids, transient ids, robust queries, tracking queries, etc. We could also cover common problems, gotchas, tips n' tricks, that sort of…
-
How to use Move boundary in FeatureScript - opMoveBoundary()
I was having trouble finding how to use the Move boundary within FeatureScript. There is no OpMoveBoundary or OpExtend like you would expect. Here is how you can do it: Import the extend FS from Onshapes STD at the start of your project. // For move boundary import(path :…
-
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.…
-
opPlane
Hi, I have used OpPlane operation in a feature script but i can't manage to display the name of the plane on screen as opposed to the feature Plane. Can someone help me on this topic please ?
-
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…