-
UI Label
is it possible to have a 2nd line label in UI?
-
For loop for annotation creation in FS
My plan: I just wanted to create quick new version of the "Part Number" property example FS. When I looked at the code I was suprised by the extreme repetition in the code. I think it could be solved with a few small lists. But it seems that the limitation is annotation creation that does not accept for loops. annotation {…
-
ENUM LIST
can i add something in the enum list using user input in the precondition? is it possible?
-
Function Lesson
I badly needed lesson to fully understand how to do this. Is there a tutorial or lesson out there ?
-
another function question
lets say a feature that gives 'data' whatever the user pick line & line = data plane = data how to do an export function to get 'data' usable to other fs?
-
New FeatureScript: Pocket Holes
Hi everybody, I would like to share my first FeatureScript: Pocket Holes. The feature is very straight forward: * Choose entry face * Choose exit face * Select vertices where the pocket holes will be created * Select thickness of part that will have the pocket holes You can find the FeatureScript…
-
Get Lines of a Sketch and angle between 2 lines with coincident vertice.
I couldn't find an evLine that works with an sketch. var sketch1 = newSketchOnPlane(context, id + "sketch1", { "sketchPlane" : newPlane }); skRectangle(sketch1, "rectangle1", { "firstCorner" : vector(-1/2,-1/2) * inch, "secondCorner" : vector(1/2, 1/2) * inch }); I want to implement something like an sketchFillet and it…
-
Can Featurescript pull data from Google Docs?
I used to have a VB program in Solidworks that would popup a dialog window. In that window I would use a dropdown box to pick the Project name, and a commodity type and then the program would create a prefix and then pull a sequential number from an Access database to create the part number. Is it possible to go something…
-
Shortcut for copying all
What is the shortcut key to copy all in feature studio? Where can I find the list of all shortcut keys?
-
how to check if a string includes a substring?
how to check if a string includes a substring?
-
RealBoundSpec Question
-
coordsystem question
-
Guide curve or more profiles for lofting.
I am lofting a changing profile P(t) where t is a parameter tmin < t < tmax. I can generate the profile at any t so any number of intermediate profiles are possible. I could also generate the guide curves for the profiles. However is there any benefit to using guide curves if I can just generate more intermediate profiles…
-
SELECTING FROM THE FEATURE TREE
Is it possible to select a derived feature in the feature tree without user selecting it?
-
How to find all intersections points of an edge chain with a plane
For example I have the loop of a face by var loop = qLoopEdges(def.face); and I have a plane p var p = plane(....); and I would like to find all the intersection points of this loop with the plane. Is there an inbuilt function to do this? More precisley if I have selected the sketch face in grey I would like to find the…
-
EXPORTING VALUE
How can I export this value?
-
How do I select an adjoining part in FS
I have a part studio with multiple parts, I want to be able to select 2 faces on one part and then also work on the part that adjoins it as below: The mock up is available at https://cad.onshape.com/documents/1d8686fa8d2943b37843e397/w/4b929d003a5a139e2f77286e/e/e0979796b001bdae18a9981c I can easily get all parts by using:…
-
Is there an interactive query explorer?
It would be useful to help my understanding of the various qXXXX() query functions to be able to use the UI to explore what they did. I envision a FS with a dropdown menu of most of the query functions (qLoopEdges, qVertexAdjacent, qConvexConnectedFaces etc. etc.) and some input fields. I could then select a function from…
-
CAPTURING USER INPUT
how can i capture user input from the ui and make it as attribute?
-
How do I correct holes that are on the wrong axis?
Thanks to some previous help here, I have managed to cut some holes using the hole tool but depending on the orientation of the part the holes end up incorrectly positioned. Not actually an issue currently as I will always work in one plane but I would love to make the feature universal for future proofing. Correct holes:…
-
SKETCH PLANE
can i query what coordsystem is the sketch created?
-
Are sketch operations like "offset" or "split" available in featurescript?
Are sketch operations like "offset" or "split" available in featurescript?
-
In Precondition, how do I set a default value for a Boolean?
I can set a default a default for an integer or float with something like: isInteger(definition.numberOfHoles, { (unitless) : [1, 10, 1000] } as IntegerBoundSpec); How do I set the default for a Boolean? Is there a "BooleanBoundSpec"?
-
Questions about units
I've more or less finished my first real feature script. Thanks for all the help! I had excellent help from the forum. I have questions about values with units. I think everything in the database has meters as the length unit. Other units are assigned as conversions from meters. When I print values via "debug()", the…
-
How do you bring numbers in as a precondition
I want to bring a simple unitless number in as a multiplier. I also want to restrict the range and assign a default value. annotation { "Name" : "Scale" } isLength(definition.scale, { (inch) : [1, 1.059463, 1.07463] } as LengthBoundSpec); this works, but I think I want this: annotation { "Name" : "Scale" }…
-
Queries, queries and more queries ...
Here is a simple FS: FeatureScript 736;
import(path : "onshape/std/geometry.fs", version : "736.0"); annotation { "Feature Type Name" : "FS Test" }
export const fstest = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Plane", "Filter" : GeometryType.PLANE ||…
-
How do I get the length and vertex values of a simple edge
Is there a simple example of how to query an edge for length and vertices? I've looked through several .fs examples and I get lost on what is relevant to my question. In particular the concept of context. If I pass in the edge in precondition, what should the context be when I query that edge?
-
Can points be added to an existing sketch with feature script?
I want to add functionally derived points to a sketch to use as anchors. Can I do this with feature script? In a way I'm asking to create a custom constraint.