-
Deleting Multiple Sketches with one opDeleteBodies???
I am working on a featurescript for taper lock bushings that will have something like 50 sketches/fitSplines after I work in all available sizes/hole patterns. Individually deleting bodies is helpful during custom feature generation, but, imo, makes the script unnecessarily long once finalized. Is there a way to delete all…
-
Slick trick for force closing a sketch profile in FS?
Howdy, My company recently switched to OS from Alibre so I am re-vamping all of our configurators with FS. This went super well for roller chain sprockets/bushings but I am struggling with welded steel and pintle chain sprockets because the mathematics in the ASME are JUST imprecise enough to prevent a closed sketch…
-
Trying to translate loft() to opLoft() in FeatureScript
Hi featurescript experts, I am trying to loft 2 organic shapes together using Featurescript opLoft() but I am just unable to get it to work, though I am able to achieve the result I want using the user interface which generates code using loft() instead of opLoft(). Here's the link to my test…
-
Multi Mate Connector request
@konstantin_shiriazdanov This is a great featurescript A couple things that could make Multi Mate edits faster * Display translate (offset) & revolve x,y,z delta coordinates for each item in the Transform array dialog * Ability to reorder those items
-
Best ways to create a 1:1 relationship between a set of queries and some other settings?
I'm working on a feature that generates a list of parts, which should have some values associated with them by the feature. Later (in the same feature), when I query one of those parts, I want to be able to get a list of the settings for it. I thought I might be able to use the query itself as the key to a map, which would…
-
Boardfoot Estimate (New Custom Feature)
We make custom handmade furniture and a big part of the design process is estimating stock. Rough wood is commonly measured and purchased in "board foot" (abbreviated bdft, bf). I created this super simple feature to show the bf measure in the featurelist. The feature uses the part's volume to convert to bf. Optionally,…
-
Custom Feature Update
Hi, I have used a custom feature of the Tangent plane when sketching, and it appears we have an update as per the attached image but I don't want to update the feature. Is there a way I can lock it so that the blue symbol can disappear, I understand it's possible to do this in assembly using Pin Reference. The reason I…
-
FS working in file with featurestudio but not when added to tool bar?
Hi All, I am wondering if anyone has experience trouble shooting this: I have a sprocket feature script that functions perfectly in the main file, but fails on a specific user input combination once I have added it to my tool bar in a different document. In the screen shot below the lefthand view is a close up of my…
-
How to read in specific variables from a CSV based on user inputs
Howdy Folks, I am trying to scan the first two columns of rows in a CSV using two numeric user inputs as the search key and find a match. Then, return the remaining two column values as variables required for creating a hub on a sprocket. Every simplification/variation of the code that I have tried returns the same…
-
How do I query an object after a boolean union?
I'm creating a feature that allows me to extend multiple walls up to a target height. * Select the top face of a wall element. * opExtrude a calculated distance to create a new wall element. * opBoolean union to join the two parts * I need to select the part created with the opBoolean to modify its attributes. I see the…
-
Passing in featureList as Argument, but not from a Feature Parameter
I'm in a slight dead end figuring out how a feature I've written can be used by some other features, when the feature has an 'is featureList' input (to ingest all the things created by a feature, which may vary). See the below example, where I want the thing represented by 'fList' to be a featureList type, and for it to…
-
FeatureScript name is red
Hello I wrote a feature script that runs without error, but the name of the featurescript is highlighted in red. Even closed. Why ? https://cad.onshape.com/documents/b779fbc5c77223353d4ce6aa/w/5beeb6a22fc35205de002ae9/e/d808d6b0bcd0567c369b865a?renderMode=0&uiState=64d9f243c22dde25a208712e
-
Why debug feature is not displayed ?
Hello, When I use the debug feature on a vector, the data are displayed in the FeatureScript Notice, but the lines are not drawn on the screen.I thought they should appear, right? I use the debug feature to display these lines on the sketch { // 1st line var line1Start = [x1, y1]; var line1End = [x2, y2];…
-
setExternalDisambiguation - Multiple Face Replacements on a Solid Body
I'm trying to create a feature that will approximate a number of curved surfaces, usually just 4 sided, with simplified planar surfaces using ReplaceFace. Taking three vertices from a face and turning it into a plane which replaces a face. If there's only one curved face in the solid body, then it works fine. But I can't…
-
Is it possible to configure properties of a body with Featurescript?
I'm trying to find out if it's possible to configure a body using Featurescript. The concept: -Prompt for two user-selected bodies -Get string from property "Name" of each part -Create a new simple body (in this case a cylinder) -Configure the cylinder to have two configurations -Set configured "Name" properties of the…
-
FeatureScript behaviour
I'm trying to understand how FeatureScripts work. I wrote a simple script :: export const main = defineFeature(function(context is Context, id is Id, definition is map)
precondition { annotation { "Name" : "Select Spline", "Filter" : EntityType.EDGE, "MaxNumberOfPicks" : 100 } definition.curves is Query ;
} {…
-
FeatureScript Notice
Hello, Is there a way to clear the FeatureScript Notice ?
-
Spline with an array
Hello I need some help with the spline.I wrote a feature which draw a spline from a csv fileInside I use this code } else if (linetype == "C") { var P1 = point_courant; var P2 = vector(aline[1], -aline[2]) * ZoomCoefficient + splineOffset; var P3 = vector(aline[3], -aline[4]) * ZoomCoefficient + splineOffset; var P4 =…
-
FeatureScript TableData not effective.
I write a FeatureScript which has to import a csv file : export const CSV_Path = defineFeature(function (context is Context, id is Id, definition is map) precondition { annotation { "Name": "file" } definition.myPathCurve is TableData; My problem is that half the time the file is not read The script starts correctly, If I…
-
println units
Hello Here is a small piece of code: var sketchPlane = evOwnerSketchPlane(context, { "entity" : definition.selectedEdge }); var n = 100; var samples = evEdgeTangentLines(context, { "edge" : definition.selectedEdge, "parameters" : range(0, 1, n) }); var origin = worldToPlane(sketchPlane, samples[0].origin); println(origin *…
-
evaluateSpline: Parameter at index 0 is outside the knot vector
I used a Split feature on a curve (helix) entity, and wanted to then subdivide this split version of the entity into line segments. However, I got the below error. Is this because the curve needs to in an ideal world be reparameterised between 0 and 1? Has the split operation done some funky business where it's almost…
-
skFitSpline and bSplineCurve .controlPoints
Hello, I draw a spline on sketch1: skFitSpline(sketch1, "spline1", { "points" : [ vector( 0 , 0) * centimeter, vector( 100, 100) * centimeter ], "startDerivative" : vector(150 , 0) * centimeter, "endDerivative" : vector(0 , 150) * centimeter, }); test: same with code formatting <div> skFitSpline(sketch1, "spline1",…
-
Reading feature related infromation
Is there any way to get the information added in feature script(samples below) through api. throw regenError("This is a regen error");reportFeatureInfo(context, id, "Some error found"); https://cad.onshape.com/documents/a63f2300d0234e62b89f906d/w/1432bb01183f19577aa937e2/e/32e2592e0830a05993a8a875
-
Seeking featurescript for: select 3 points, automatically generate triangle surface face
Does anyone know if something of the like has already been made by someone? I am seeking the ability to select 3 points anywhere on my model, then fill a triangular face there. I am currently using bridging curves and the fill tool, but would like to consolidate down to a single feature as this is a relatively frequent…
-
RayCast Result: Entity Equivalence in a TransientId
I have an input surface that I am casting rays onto, but as well as this surface I am also casting rays through another object's faces. I'm trying to see which ones reach the surface and which don't. So I'm attempting to use the transientId in the RaycastResult map. What I'm finding though, is that evaluating the surface…
-
3D polylines with featurescript?
Hi. I want to make featurescript where I can make a 3D polyline with featurescript. When the polyline is created I also want to be able to make sketch fillets on the corners afterwards. How should I approach this? One of the featurescript samples is "Featurescript 3D spline". Can I use this as a basis?…
-
Overriding 'Expected Query' when running an imported feature within another
I've had a little dabble with importing and running a feature from a different document within another feature's body. What I'm experiencing though is that where the imported function expected queries for vertices etc, I would like to be able to pass in vertices which have, for instance, been calculated/determined in a way…
-
Query that Resolves to nothing != qNothing()
I stumbled on some strange behaviour I couldn't figure out. What I thought was quite a straightforward conditional where I do a qSubtraction, resolved weirdly. As below. const allGeom = qCreatedBy(id + "extrudeThin", EntityType.FACE); const planeGeom = qGeometry(qCreatedBy(id + "extrudeThin", EntityType.FACE),…