featurescript
Discussion List
-
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.
-
I'm having trouble with skPolyline --- ALREADY ANSWERED...
I am having trouble with this code: var fPoints is array = []; var L = 10.0; var CL = L; var Rule = 1.0 ; for (var i = 0; i < definition.numberOfF; i += 1) { fPoints = append(fPoints,vector(0,CL*inch)); CL = CL/Rule; } skPolyline(sketch1, "polyline1", { "points" : fPoints }); I'm getting "Precondition of skPolyline failed…
-
Featurescript Custom Icons
Is there any way to set an icon for a custom feature that I have created? This would be extremely useful in distinguishing my custom features
-
opBoolean FS Question
Can I do opBoolean without user selecting the "targets"?
- opExtractSurface on Derived feature - NOT touching the one sided edges
- opExtractSurface using derived feature
-
@opBoolean: BOOLEAN_SAME_INPUT error message
I am trying to create 2 holes in the same body using an adaption of the featurescript from "Dowel and Minifix", I can create and subtract the first hole and create the cylinder for the second hole but when I try to subtract that I get the error "@opBoolean: BOOLEAN_SAME_INPUT". My code is as follows: <div> // Create Hole…
-
Selecting Derived Sketch
can somebody explain me , how to achieved this. I have sample code that I can use but I want to know the basic.
-
Add tooltip to feature
How do you add a tooltip to a feature like the builtin ones? If you add a "Hole" and hover over "Sketch points to place holes" you get a tooltip saying "No points selected" and on a chamfer if you hover over "Entities to chamfer" you get a tooltip "select edges or faces to chamfer". I cant locate the tooltip text anywhere…
-
getting the copied sketch
if i copied a sketch, how do i get the 2nd sketch programmatically in FS?
-
vector or plane question
can somebody explain this?
-
Either or selection of edge or face in featurescript
Sure I am missing something really obvious here but I cant see how to allow selection of either a face or an edge in featurescript.
-
Using a for loop for multiple operations on multiple parts
Hello, I have a script that makes a new sketch on a selected face, draw a rectangle, extrude and finally a Boolean subtraction. Currently it only works for one face at a time. How could I use a for loop to allow the operations to be done on all selected faces? This is for a mortise and tenon script I'm writing and when I…