-
How to calculate distance across a surface?
My goal is to write a script to add a hexagonal pattern of hexagonal tiles across a series of adjacent surfaces. However, I'm new to Featurescript so at an early stage. Where I'm stuck at the moment is trying to convert from real-world distances to the "2d unitless parameter-space" used as parameters…
-
Configurations update: Edit FeatureScript IDs
In addition to the other new features already mentioned, Onshape 1.78 added a piece of functionality specifically for the purpose of writing FeatureScript that builds configured Part Studios. As you may already know, the user-facing names of configuration inputs and the user-facing names of configuration table rows can be…
-
Using partQuery in FeatureScript to retrieve parts
Hi, I noticed the "get parts in PartStudio" returns a partQuery that looks like below: "partQuery":…
-
Evaluate existing FeatureScript using API
I understand the 'Evaluate FeatureScript' endpoint takes in "script" and "queries" in the body of request for API call and I have had some luck using the API this way.But I keep thinking there should be a way to reference an existing FeatureScript that lives in a document. Does anyone have any experience doing this?…
-
LaserIt Feature Release
Hi Onshapers! I just finished this feature called LaserIt, which takes an arbitrary 3D solid and slices it to be laser cuttable (or some other 2D planar machining technique). Here are some images of it in action! I'd love to hear what you think!…
-
"For Each" feature in Onshape?
This could be an improvement request or feature script thought, but I've been noticing that there are a few features that I have to set up multiple times, when really I'm doing the same thing. For example, I need to make a new feature for every "Fill Surface" call, even if I want to use the feature on a hundred individual…
-
Calculate Bounds
Hello I use onshape to prepare parts to Cam when I do
so I do create a stock That in close the model and I did find this very nice featurescript. Called Calculate
Bounds The only
problem with this script is that I
cannot control if I want to more offset in X or Y or Z. Do someone now how you can add an offset tab. maybe
if…
-
How to create a Natural Spline / Minimal-Energy Spline
I'm working on a new FeatureScript to quickly create hose routings: In the FeatureScript I can select a start, end and midpoints. A fitspline is going through all points. * Now I would like to know how to create a "Natural Spline / Minimal-Energy Spline" This means that the spline should behave like a bend hose/wire. * Can…
-
Surface Pattern - with options [NEED HELP]
Hi folks, I have a need to produce a pattern of counterbored holes, that share a normal direction, but the depth of which is driven by (with an offset) a surface or series of surfaces. (here's a link to this doc, for what it's…
-
Extrusion Direction based on Collision Evaluation
Hello, I am trying to create a routine that changes the direction of the extrusion based on a collision evaluation. The script performs this task right after sweeping a cylindrical structure. My goal is to extrude another cylinder (different to the original), in the opposite direction. My initial though was to use the…
-
Fill Pattern FS Bug
@paul_chastell & @NeilCooke While testing out the new square/hex option that Neil slipped in, I found an interesting bug. When the target face has an adjacent coplaner face, Fill Pattern doesn't respect the boundary and creates unwanted instances on the neighboring face. I know that's the kind of thing one would expect in…
-
How do I scale skText in-situ from featurescript?
Having read all the previous answers to this question and tried various combinations I still cannot work how to scale skText in-situ. The roman numeral clock example was too complex for me to adapt and the other simpler methods do not work for me. I want to write a function I can call from other FS code to place a small…
-
skText too big, how can I define its origin and sizes on sketch?
Think the title says it all, I want to place the text in a certain position (above my aerofoils) also, changing skText to construction doesn't seem to do anything? Kind regards, Darren
-
Boolean- Intersect operation with "Select all bodies" option
Hello, We are trying to find a way to automatically select all the bodies in a part studio for an intersect boolean operation. We are far from getting a satisfactory result but learning FeatureScript has been fun, does anybody have an idea or recommendation for this task?
-
Featurescript - Sheet Metal Thicken
Hello, I have a simple task. I am trying to create a sheet metal model by thickening it from a sketch in a featurescript. My FeatureScript creates the sketch correctly, however I am uncertain on how to use the sheet metal commands. Any guidance would be greatly appreciated!
-
Creating Configuration-parameters with Feature Script
Is there a way to create a set of Configurations-parameters in a part studio with a Feature Script.(FS). So that if I say to the FS that I want "n" sets of parameters. Then it creates for example a1,b1,a2, b2,...an &bn?
-
How do I use Editing Logic Function to change input value in array using enum preset value?
I have two tabs in my UI: Array Input and an Enum input type. While the user can input the value into the array directly, I would like to enable the option of a dropdown in a different tab to override the array value if the dropdown enum is used/changed. Almost like the array input value is a default. I've seen examples…
-
qFarthestAlong producing unexpected results
I have two rectangular bodies intersecting at a right angle, and I've extracted the edges of one of the two large (cap) faces resulting from the intersection. For each of the bodies, I'd like to get the farthest edge that's perpendicular to the long axis of the body. I had assumed that passing a direction vector parallel…
-
difficulties with circular pattern of an opSphere
I have difficulties doing a circular pattern of operations, especially with the opSphere operation. Don't know what's wrong and Onshape says regeneration complete. Any suggestions? document link: https://cad.onshape.com/documents/8e26d19f48d94a039d8e8399/w/d0ca70e6dd864413dcb64308/e/b830d5993f0ebf5a2041c6e8 Thanks!
-
Filleting edges created by an extrusion using startTracking?
I'm working on a digital (i.e. cnc router-cut) joints project, and many of the joints will have extruded geometry with fillets on the vertical edges (to accommodate cutter radius) that gets subtracted from another body to form the joint. One example is this "Halved Dovetail" I create the feature by creating the half lap…
-
setFeatureComputedParameter leaving quotes
I am currently making a feature that requires using the setFeatureComputedParameter function to set a custom label. However, when I use it and I pass a custom string onto the function, it leaves quotes around the name in the feature tree. For example, if I do setFeatureComputedParameter(context, id, { "name" : "label",…