-
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).
-
Building a full model with featurescript?
Out of curiosity - does anybody here use featurescript to build "full models" rather than well... just features? I haven't really dug into featurescript myself, but plan on it when I have some time. I have found many custom features created by other users extremely useful, but I don't really know what I'd try to use it for…
-
How can I make an array of points created by a for loop in featurescript?
for (var i = 0; i < numberOfDowels; i += 1) { opPoint(context, id + ("locationPoint" ~ i), { "point" : toWorld(cSys, vector((fenceDistance + (dowelSpacing * i)), 0 * inch, 0 * inch)) }); } var locationPoints is array = evaluateQuery(context, qCreatedBy(id + ("locationPoint" ~ i), EntityType.BODY)); This gives me an error…
-
opSplitFace - Invalid Input
I hoping someone can explain to me why this script is failing: https://cad.onshape.com/documents/13e9c12a44cf54f198c08ea5/w/2c9e84ed0d4301b95e18ebf2/e/ed69f87a561cc4d22f3deb33 Ultimately this is to be part of a more complicated script. I wrote this simple script to troubleshoot and apparently I don't understand what…
-
skConstraint / Newbie to featurescript
I'm just starting to work with featurescript and I have no programming experience so there are some large gaps in my knowledge. I've been working off of a script written by someone who actually knew what they were doing which imports solid tool-bodies from a separate context and uses them to create machining details at…
-
list of boolean
I want to export a list of boolean , similar to export enum but list of strings, where user can check 1 or more strings. Can somebody point me to the right direction?
-
Featurescript - Evaluate centre of circle
I am embarking on my first custom feature creation! I have run into an issue someone might be able to shed some light on.I have selected the edge of a circle and would like to get the centre point to place a hole on. I have the below code to evaluate the selected circle: var circleCentre = evCurveDefinition(context, {…
-
Hole Feature Naming
Is it possible to create a hole feature that names the feature the same as the tap information or clearance information? For example if a hole feature creates a tapped hole for a M3x0.5 screw, the feature would be called M3x0.5, and if the hole feature creates a clearance hole for the M3x0.5 screw, the feature would be…
-
How to get adjacent sketch entities?
I'm trying to use qAdjacent to find entities in the sketch which share a vertex, however qAdjacent only seems to work properly for non sketch entities. If I select an edge on a body it works fine. My query is: qAdjacent(qNthElement(definition.myEdges, i), AdjacencyType.VERTEX, EntityType.EDGE)<br> It works just as expected…
-
Projection of an edge onto a sketch
considering I have an edge selected(input) and would like to project that edge onto a sketch from a feature script, using the 'skConstraint' command in the feature script is the solution but i am unable to figure out the syntax for using the 'Projected' constraint type in this situations. any suggestions????
-
evRaycast not reporting all face intersections
I'm trying to use evRaycast to get all points where a ray intersects the face of a body. It mostly seems to be working however I have run into a strange issue. A single point is missing from what I would expect to be an intersection. I've included a screenshot where I have circled the "expected point" in black and a link…
-
Linking a configurable variable in an assembly
Given that (to my knowledge) there is no way to have a sketch text linked to a configurable variable I went ahead and wrote my own feature script that takes a text field in the from a configurable variable and engraves said text onto the part.This part is then used in an assembly and I want to, in the assembly level, be…
-
Creating Plane through 3 Points in featureScript
Does anyone have any tips for creating a new plane through 3 points. Have not had any luck with all test attempts of cPlane, opPlane, etc. var b = vector(32, 56, 0) * millimeter;var a = vector(88, 0, 0) * millimeter;var c = vector(88,56,50) * millimeter;var _origin = (a+b+c)/3;var _normal = cross((c-a), (b-a));var newplane…
-
Sketching in FeatureScript - Coincident constraint between two vectors
I'm currently learning how to sketch in FeatureScript. I want to know if there's a way to sketch with constraints before using skSolve. For example if I want to make a tangent arc with its two end points coincident to two end points of a pair of parallel lines. The arc has to be tangent with both lines. Is there an easy…
-
Ellipsoid custom feature
In support sometimes we get a chance to create tools that bridge the gap between current functionality and potential future functionality through the use of FeatureScript and custom features. In this case, a feature to create ellipsoids! With independant x/y/z dimensions. Check it…