-
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…
-
Lighten Feature with Text
@ilya_baran I have been using the lighten feature you created with success. However, I have noticed something. If there is a remove extrude of text before the Lighten feature, then it does not work, the text however can be placed after. This did catch me out! But wanted to find out, what is it about the text that is…
-
Custom Beam Profile
So after adding the new profile to the code, how do I use the feature in my documents, all that shows up it the original beam feature, the edited one only shows up in the document which I created it in.
-
Conditional visibility of array parameters
Is it possible to have a parameter array whos individual sub-parameters can be driven by array-level logic? I don't know why, but the below precondition code does not work. I get tagged with an error on the boolean condition of the if statement. It looks like I can't reference individual "arrayVar" parameters. Is there a…
-
Feature interface programming
I am writing a feature that has a significantly complex interface. This means that the precondition in the feature is a mess. Is there a way to simplify the precondition? Such as loading annotations from another FeatureScript file, for example.
-
Featurescript Text Size
Hey FS community, I am using featurescript for a project and would like to engrave some text. However, the default text is waaaaaay too big and I can't find anything in the standard documentation of sktext for how to change size. Is there another way to create text? Am I missing an option to change font size? Thanks for…
-
Loft sketches using FeatureScript
Hello, I am trying to build a FeatureScript that will take external data, generate offset sketches and loft them. Each sketch is essentially a profile. However, I am having difficulties creating an array of sketches or profiles to then pass to the opLoft function #N00B. Could anyone take a look at my code? FeatureScript…
-
featurescript
Hi, The code is available here https://cad.onshape.com/documents/12312312345abcabcabcdeff/w/a855e4161c814f2e9ab3698a/e/b4277d7ee5ca49a493856c34 but how do we search in it ? The lack of doc of featurescript could be mitigated by an easy way to search in the code. Could we download a zip and grep locally in it ? For exemple,…
-
How to I evaluate a query and store one of the resulting entities?
Hello, I am hoping you can help me. I would like to find the 2 largest Cylindrical surfaces on a part by surface area. I can do this, but I think there must be a better method? I am used to object oriented programming in java where I could store this sort of thing using an object. I havn't put the full code (as it long and…
-
Is there any video tutorials for building parametric curves with functions with FeatureScript?
Like parametric curves by interpolation and Bezier curves. Im completely new to featurescript and i have been having a hard time learning it from the material disposed by onshape.
-
duplicate an entity from a sketch
Hi using const outsideCircle = sketchEntityQuery(id + "toothSketch", EntityType.EDGE, "outsideCircle"); Is it possible to create a new sketch and duplicate the entity outsideCircle onto the new one ? (or should I keep the original parameters in variables to be able to do a new skCircle/sk... ?) thanks,
-
iterate over intersection points
Hi, Is it possible to iterate over all the vertex that intersect with an array of query object ? For example, I have those 2 circles. How do I iterate over the 2 intersection points ? const e1 = sketchEntityQuery(id + "gearSketch2", EntityType.EDGE, "baseCircle"); const e2 = sketchEntityQuery(id + "gearSketch2",…
-
query point coordinate
Hi, I have a feature script which creates 2 line and place a point of the intersection, like skPoint(gearSketch, "A", { "position" : center + vector(1, 0) * (pitchCircleRadius + addendum) }); skConstraint(gearSketch, "A_coincident1", { "constraintType" : ConstraintType.COINCIDENT, "localFirst" : "A", "localSecond" : "axis"…
-
skconstraint on the circle center
Hi, I have a line and a circle. The line is fixed and I need to place a circle at a specific position, tangent to the line. skCircle(gearSketch2, "baseCircle", { "center" : center, "radius" : arcBase.radius, "construction" : true }); skConstraint(gearSketch2, "Base_tangent", { "constraintType" : ConstraintType.TANGENT,…
-
An automated way of exporting part contours and pockets into 2D vector with different layers?
Hi, I've been using onshape for few months now and It is a great software. I am trying to improve my workflow for routing and cutting 2d shapes in my cnc and laser cutter. For the moment I am forced to create manually the 2d views for each part, export them and edit the vector drawing to split the vectors in different…
-
Accessing Feature Browser thru Featurescript
Is it possible to access the #Variable in the feature browser by Featurescript?
-
Featurescript to select the variable
Is it possible to use featurescript to select the #variable array? I have a #Variable array that I would like to select using UI booleans.
-
Need help with feature naming template
Hi, I am struggling with the feature naming template and have already checked most posts currently on the forums but from what I can tell my example should work: feature definition: annotation { "Feature Type Name" : "Profile Generator", "Manipulator Change Function" : "flipManipulators", "Feature Name Template" :…
-
Featurescript: Can't get qEdgeAdjacent to work?
This basically my code with some bloat stripped out. It creates an edge between two points and extrudes it into a face, then into a body (a door in this case). I then want to extrude the face along the hinge so that I can form a union with the door frame (i.e. not just joined at an edge). I'm getting there but not sure on…
-
How to find extent planes for a solid in a specific direction
I have created a feature script feature. The user can select * S is Solid * P is Plane I would like to generate two planes that bound S in the direction of normal to P Before: After: Any ideas how to do this?
-
How to import a sketch into a feature script and then in a loop make copies of it along a path.
Hi there, I have a sketch in my document. It has 3 variables set MidThickness Width Height the variables parameterize a cross section profile along a boat hull. I would like to create a feature script feature that imports the sketch and then in a loop makes copies of it. I have imported the profile into a feature like so…
-
Get vector for edge direction
I am writing a feature that requires me to select a vertex and returns the vectors corresponding to the direction of the edges that meet at that vertex. Is this possible? Thank you.
-
Feature Name Template includes container symbols
I would like my feature to set its name based on the type of part it's creating. It works correctly but it looks ugly because if I use setFeatureComputedParameter to assign a string to the feature name, I get the quotation marks in the name of my feature. This seems to also be the case for an array. As far as I can tell,…
-
constructPath returning error, need advise on correcting
I have this line: var upperQueries is Query = qUnion([sketchEntityQuery(id + "sketch1", EntityType.EDGE, "upperLEArc"), sketchEntityQuery(id + "sketch1", EntityType.EDGE, "UpperLE_Spline"), sketchEntityQuery(id + "sketch1", EntityType.EDGE, "UpperTE_Spline"), sketchEntityQuery(id + "sketch1", EntityType.EDGE,…
-
Determine which options were selected when previously using a feature to create a part?
Is there a way to access a piece of information that was input by selecting an enum value to create a feature, the next time that feature is used? For instance, if I made a feature to create cube with an enum option for filleted edges, would it be possible to then use featurescript to query that cube and determine whether…
-
Writing a measured value to a variable in the model tree and keeping it updated.
Essentially I'm trying to recreate a 'sensor' or User-Defined Measurement. In the simplest case I have an arc, would like to evaluate it's length, then store that number in a variable so that I can reference it later in my model tree. I'm just jumping into featurescript so it's not immediately obvious to me how to do this,…