-
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",…
-
'Bulk Update' to a version
I have around 20 part studios in my document, all of which are driven by properties in a FeatureScript object in the document. Then there are half a dozen or so assemblies and a couple of drawings. When I make a change in the Feature Script (to correct an error or to feed some parameters to a new Part), I have to create a…
-
Deformed Beams FS
Hello all, I present my first FeatureScript: Deformed Beams. With little experience in programming I set out to create my first FS to gain more knowledge on the subject. I created a FS that calculates and displays the deformation in beams with "simple supports" on each end. Before using the feature you will need to know…
-
Enum used as a parameter type must be exported?
I am trying to use the BoundingType enum in a Featurescript that I'm developing that includes an extrude. I keep getting the error "Enum used as a parameter type must be exported" when I try to use the BoundingType like so: annotation { "End Type" : "End Type" }definition.endType is BoundingType; The BoundingType enum…
-
How to use regenError?
I am trying to write a feature with error detection, and I'm trying to use regenError to highlight a query in red when it doesn't comply with the required selection. The code I am using is: throw regenError(ERROR_STRING, ["distEnts"]); Where "distEnts" corresponds to "definition.distEnts", the query in question. This is…
-
Use opFillet for a sketch?
Hi, I'm trying to use opFillet to fillet corners in a sketch but I'm only getting not really helpful errors like FILLET_FAIL_SMOOTH and FILLET_SELECT_EDGES. Here's a current snippet (I've tried many variants) var outerSketch = newSketch(context, id + "outerSketch", { "sketchPlane" : qCreatedBy(makeId("Top"),…
-
can i create a method ?
i need to create a method , because i need to do some operations into this method ...so, when i call this method, but how can i create a method and how can i call this method?
-
Is there a getAllVariables()? Specifically Configuration Variables.
Is there a way of accessing a list (map) of all (configuration) variables in a Part Studio? Perhaps a way of accessing the input of the build(config) function? Basically a getAllVariables() is what I'm after, in the spirit of getAttributes(...qEverything()...)
-
opFillet availability in sketches?
I saw in a post a couple of years old, that opFillet is not available in sketches. Has that changed in the last two years? I'm working on a project to generate digital wood joints, and many joints consist of two parts joined with complementary geometry. Frequently, I use the same sketch to generate the complementary…
-
Choosing inputs based on Lookup tables
Suppose I have a parameter definition.table based on the following lookup table: "Color" "Reds" "Light Red" "Dark Red" "Blues" "Light Blue" "Dark Blue" Is there a way of having definition.table determine whether or not a second parameter shows up in the feature UI, based on whether the user selected "Reds" or "Blues"? I…
-
holes to points in circular pattern
i want to do holes. i created points in a circular pattern as the center for the holes. no i have difficulties defining the locations and the scope in fs for the holes. const anzahl = dimensions.Rotation; for (var i = 0; i < anzahl; i += 1) { const t= rotationAround(rotationAxis, (2*PI* radian) * (i/anzahl) ); const…
-
Call skEllipse(Id (array), string, map) does not match skEllipse(Sketch, ..., ...)
Im have some difficulties with my first Loop. I'm trying to create ellipses on different sketches. heres the code I want the ellipses to be on different sketch heights, but they are all on the same heigth. Any suggestions?
-
LOFT_SELECT_PROFILES error
I'm trying to create a loft from a defined face to an created point. I always get the error LOFT_SELECT_PROFILES. //Loft var top = (normal * definition.Height) + origin; const vertexID = id + "topVertex"; opPoint(context,vertexID,{point : top}); var topVertex = qCreatedBy(vertexID, EntityType.VERTEX); var profiles =…
-
Computing transform for use with Instantiator
I'm writing a feature with two primary inputs: a face on which to add the whole-lie feature, and a set of points specifying locations to instantiate them. I'm having some trouble figuring out how to combine the two into a transform for the effect I'm looking for when calling addInstance(). My current effort uses…
-
F1 Style Cambered Aerofoil Feature Script
I've been using Onshape for a while now, I lecture in Aerodynamics at Northumbria University in Newcastle, UK and actively use Onshape as part of the modules I teach across different Engineering disciplines. Recently I've been working on a slightly larger project with students to design an open-wheeled F1 style car and…
-
thickness of a cuboid
After selecting 2 vertex to create cuboid, How can I get the cuboid thickness by query?
-
Can we use FS to set the "Exclude from BOM" property.
Hi folks. I have a part studio that uses configurations to create a laminated material. I have the configuration table set a sensible PN and name description for just the first layer of the laminate but I'd like to exclude all the other layers from the BOM. Rather than set many values in a table for each config option I…
-
area of each face
How can I get the area of each faces of a box? It gives me the correct number of the faces but I cannot get each area of the faces. evarea is giving me the total area of all the faces.
-
Getting the value
-
wrong type Number- what does it mean?
-
How to improve the onshape featurescript manual
As the shopworn cliche has it, a picture is worth a thousand words. Now it is scandalous that the manual for a highly visual system like onshape cad lacks so much as a single illustration. One is left to try to picture in his mind the concepts being explained in the manual as best he can. This will never do if onshape…
-
PLANE_OFFSET_BOUNDS
can somebody explain why I am getting this error?
-
array parameter - how to use
Can somebody explain or sample on how to use this?
-
query question
how to query a transient?
-
Editing interface labels
I am writing a rather complex FeatureScript feature that takes in a length as an input, stored in definition.length. Depending on a few options (enums), I would like the label of this input to either read "Edge length", or "Short edge length", or "Long edge length", while still storing the value in definition.length. I…
-
qParallelPlanes
How to use qParallelPlanes ? Will it give me plane/face of the part parallel to the ref plane selected?