featurescript
Discussion List
-
CSV FILE READING ISSUE
I have the following issues while reading from the CSV file: 1. Sometimes I am getting unwanted characters like "���". 2. I have a character like 'µ' in the CSV file. But after reading I am getting "��". anyone can help. Thanks.
-
How to find the id of several bodies in "Query" with several mouse Picks
I am trying to pass the body id to rename solids with a string + i (1,2,3 ...... etc) annotation { "Feature Type Name" : "Name my_Part" } export const myFeature = defineFeature(function(context is Context, id is Id, definition is map) precondition { // Define the parameters of the feature type annotation { "Name" : "Nome",…
-
Can't Sketch on Plane Created with opPlane
Hello, I am trying to create a new plane using opPlane, then create new sketch features on it. The plane shows up, but not the sketch. The body of the FS code is below. Thanks! var plane1 = opPlane(context, id + "plane1", { "plane" : plane(vector(0, 0, 2) * inch, vector(0, 0, 1), vector(1, 0, 0)), "width" : 6 * inch,…
-
Is it possible to determine in which direction an angle is measured?
Hi everyone, I want to measure multiple angles between vectors always to the same direction. i.e. I would also receive angles larger than 180 degree for some cases. The only function I know is the angleBetween(), but it just always takes the smaller angle(<180 deg). Is there a way to always measure in the same direction…
-
New FeatureScript: Hose Routing
Hello Everyone, Good News! I'm releasing my Hose Routing FeatureScript: https://cad.onshape.com/documents/54d06a3b8abd1fcb0daba26b/w/00a336bf184d3800f0194a5c/e/e689b647e557695970d3d603 The FeatureScript uses Arcs and Circles as input (either from solids or sketches). You don't need sketches at all, which makes it more…
-
Need coordinate system (xAxis, zAxis) help for a transform
I'm trying to learn some Featurescript but am having trouble getting the xAxis and zAxis vectors for a transform. My Featurescript UI has the user select a start point (vertex), and a direction. From that I'm trying to move the orange strip (that was created by FS and is located at the origin) to the user selected point,…
-
How to query "self-referencing" entities that are generated in the feature
Hi there, This is a bit of a weird one. I want to be able to have the user give an initial set of inputs, have a script that uses those to generate some sketches and bodies, and then (still in the UI screen) for the user to be able to fill out a Feature Parameter Query with one of the entities created from the feature. In…
-
Automation for assemblies
Hi all, One of my company's products is a modular roof-edge solar installation. For each project, we line the roof (flat roof, think top of an apartment building) with our solar units using a small handful of configured parts. First, the base unit assembly is defined by things like solar panel size and angle of…
-
What's wrong with this opTransform input?
I can't figure out the specific problem that @opTransform: INVALID_INPUT refers to. I have checked the input, and don't see anything wrong with it. Is there a problem with the query I am passing? It's just a bunch of faces from an annotation. I tried a few others, and I keep getting this error. I tried a few different…
-
Hiding Sketch
Is it possible to hide sketch in featurescript?
-
Alternative to chamfering internal edges
I am messing around in feature script and have tried to chamfer the edges of extruded text, highlighted here. It fails on any piece of text that has a vertex with edges at less than 90 degrees. Is there another method I could use to achieve this?
-
Split using plane size?
I am trying to make a script that creates mitred corners. I thought of creating a plane and then calling opSplit. But then I realised that the plane is infinite and will not just split the desired corner, but the whole part. Is there a way of setting an "effect radius"? Such that it will only split a part in a certain…
-
Help rotating text in FeatureScript
Perhaps I'm on the wrong path, or not... Ive created a featurescript to make an array of holes. I want to add labels (text) to the holes but I cant seem to figure the best way to rotate the text so it is aligned to the holes. The following FS is my work in progress:…
-
How to offset faces for parts in a for-loop
I have a list of faces which I'm running through a for-loop to extrude each one as a unique part, attribute part metadata, and offset (inwards) each one. When I add the opFaceOffset feature I get an error message which I can't seem to wrap my head around. : Below is the error message: I have tried shifting the order…
-
[New] Extend/Trim Edges FS
With this custom feature you can select two edges and automatically extend or trim the surfaces so the edges intersect! https://cad.onshape.com/documents/cbe410e5c44c9abf4e218496/v/4a1925e806a6d04ca473a864/e/b56a4d83f2e98a1be655ccef Like my previous Fill Gaps feature, keep in mind that this may not always work on broken…
-
Adding Maps
Is there a way to "add" maps? Or to easily use one map as a the "basis" for another - i.e. I have one map that defines a bunch of generic attributes - and I want to use that - or pass it with some other definitions? I know I can make a [deep] copy of the original, then add new stuff to the copy - then pass this - but it…
-
Determine if a line lines flat against a face
I have 2 (actually 3) bodies. The two grey ones, and the purple one. I have two grey faces (one on each body) that are both circular. My purple body was created by extruding these two faces and taking the intersection. Thus, the purple-dotted-line "lies flat against" one (actually both) of these faces. So when I look at…
-
As a generate string to -> ASCII Binary (FeatureScript to generate QR )
Hi, I'm trying to create a FeatureScript to generate QR as a solid body. The question is: As a generate -> ASCII -> Binary Hi, I'm trying to create a FeatureScript to generate QR as a solid body.Is it an easy way to generate an ASCII Binary?(Surely something easy lol)const chrMap_Binary = { '=' : "00111101" ,// chr(61) '>'…
-
Correct way to do a "Center Point Arc" in Sketch in FeatureScript
What is the correct way to do a "Center Point Arc" in FeatureScript. I have tried an unbelievable amount of methods, and some seem to work, but when their points are contrained to other points on the sketch, under some angles they fall apart. The noteworthy thing here is that I need to constrain the three points to other…
-
Flip Normal in Transform Using Mate Connector?
Hi folks. I'm after some help with flipping a normal in a transform. I'm using either a sketch point or a MC as an input, and then the UIHint.OPPOSITE_DIRECTION driving definition.isFlipped For the sketch point we have this code working just fine (thanks previous helpers):- Now I'd like to do the same thing for the MC…
-
FeatureScript: Evaluate generic expression
I'm currently working on an equation driven 3D curve, but I'm having trouble getting FeatureScript to evaluate string expressions as values. For example, if #T=45, then setVariable(context, "X", "tan(#T)") should set #X to 1. Instead, it just gets stored as a string. Any ideas?
-
Finding Concave Faces
Hello All, I am just a beginner with featurescript and I am having trouble finding concave connected faces of a solid part, using featurescript. When I tried using the code shown below the debug showed all the faces of the selected solid part not just the concave connected faces. The aim is to find the concave edges using…
-
Control Flow Features (while loop, if/else, etc...)
Over the last couple of weeks, I realized that I need better Control Flow for feature execution, so I have started to hack away at a while loop feature. Have control-flow type features already been implemented? And if so, where can I find it? I have started by incorporating 'while loop' type behavior into the std linear…
-
Failed to add custom feature "Expulsores" to toolbar.
How to create featurescript with which you can work on other projects and without error of:-> Failed to add custom feature "Expulsores" to toolbar. </code>annotation { "Feature Type Name" : "RESTAR PIZAS" }// para que la imangen valga tine que ser un .sgv<pre class="CodeBlock"><code>export const myFeature =…
-
Instead of describing requests in English writing, scribe in FeatureScript directly what you mean!
Make FeatureScript capable of geometric manipulation to the core engine, to avoid the need for translation; Wow! How eficient would that be?Anyone afraid of that? Can that be done?
-
Drawing
Hi,can you suggest me if there is a featurescript function that make a drawing of a part?I want to create a part and then call a featurescript to make the drawings.Is it possible?ThanksCarlo
-
Can a specific configuration be activated by a variable in the Part studio ?
Somebody knows a way to make a specific configuration (in P.S.) conditional to a value in that P.S. EX: A configuration where a part is suppressed, is activated by a specific value of a dimension measured with “Measure distance” (MD).