-
FeatureScript: Query imported geometry
I am trying to figure out how to refer to any geometry of a feature that has been imported into a PS through FeatureScript. (Import is done using either opMergeContext() or importDerived(), not sure which one is preferable). It is important to me that there is no user selection (feature querying) involved, as I will be…
-
Mate connector
Hi! I added a mate connector to my bevels gear: https://cad.onshape.com/documents/9b04fb889def400dfd4a693f/v/49c81b9a7cb792589aff29d1/e/fc99f57d0b9bb11ec95b86b7 Is there a way to have them appear as independant Mate connectors, so I can show/hide them, and also to be able to select them from the parts list, in an assembly?…
-
Error when calling opSplitPart, CANNOT_RESOLVE_ENTITIES
Hello all, yet again I have another error, but in a different script this time. I am creating a script that splits a part into laminations, for use when creating counter tops out of many boards for example. I am using a for loop with the variable i to do this. The user selects the face which they want the board length to…
-
Fasteners creator
Hi everyone, I have started a document to easily create standard fasteners. Currently I have 3 featureScript that allow quick creation of washer screw and bolt. Each feature rely on table, currently the table are not fully completed but this is an ongoing work. I am new at featureScript and any suggestion on this document…
-
Use an editing logic function with booleans?
Can an editing logic function be used to tick a boolean check box in the UI? If so, how? Thanks Lee Hesketh
-
What is the best way to offset vectors depending if they're positive or negative?
Hello all, I have come across a peculiar error in my code. I am using a vertex as a reference point for the first corner of an skRectangle(). I am using worldToPlane() to achieve this. I am then adding a vector which is offsetting the first corner in relation to the vertex. It looks like this: skRectangle(sketch1,…
-
How to mirror a part using a plane?
I tried calling mirror, but there was no option to select entities or a mirror plane. Which function do I have to call to do this?
-
Using an editing logic function to drive multiple UI values
Hello all. Can one editing logic function be used to updated multiple changed values int the UI panel? If there are two values, let's say for simplicity's sake two length values, that are then changed in the code. Will both values be able to be updated or do ELF's only change one value?
-
skPoint unique ID's
In the following code: <br>for (var i = 0; i < 1/pointmultiplyer; i += 1)<br> {<br> <br> skPoint(theSketch,"point"+ toString(i), {<br> "position" : vector(curx, cury) <br> });<br> curx+=pointxadder;<br> cury+=pointyadder;<br> } It tells me "Can not add string and string" How else do I use a unique ID?
-
FS Hole example
The documentation is incomplete for the hole feature, is there an example of how to drill a hole in a part? Looking at the hole.fs source, it's not obvious how to do it either.
-
GeometryType.OTHER_CURVE documented but not implemented?
This query doesn't seem to work, but similar ones for GeometryType.ARC and GeometryType.LINE do: `var asCurves = evaluateQuery(context, qGeometry(path.edges[i], GeometryType.OTHER_CURVE));` The message I get is `@evaluateQuery: Unknown geometry type: OTHER_CURVE`. But the docs for the GeometryType enum do have the other…
-
constructPath using faces with holes
I'm attempting to traverse paths on a face that potentially has holes in it. Using the constructPath function throws an error with the message "Edges do not form a continuous path" in the case where there is a hole. I suppose this makes sense. Two questions: (1) is there a reasonable pre-processing I can do to the edge…
-
Vectors different depending on which plane used to create part
@ilya_baran Since you are familiar with my script, I thought it best if you had a look at this problem I have. Everything works fine except when creating the tenon after specific creation of parts. Basically, depending on which plane I use to create the sketch that is used to make the part that has the tenon, it either…
-
Use a variable in a boundSpec
Hell again, how could I use a variable as the maximum value for a lengthBoundSpec? Thanks Lee Hesketh
-
Suppressing automatic filling of disjoint polylines and keeping sketches extrudeable
I'm working on a little FeatureScript just as a learning exercise which generates a sketch based on the 10 PRINT routine. It's still rough but I am hitting a problem early on. Onshape is creating faces correctly for my closed polyline entities, however it is also creating additional faces if multiple polyline objects…
-
Get all faces of a part
Hi, how could I get all the faces of a body? I have got the body I need, I just need to iterate through the faces to find the smallest area and use that in a distance calculation. The body is a simple cuboid. Thanks Lee Hesketh
-
Query for specefic edges that are looped around faces?
Hello, still having difficulty with featurescript! I am trying to query these edges from a loop of faces: I have already got the faces, but when I use qEdgeAdjacent(), it selects the end edges as well. I don't need these as I am hoping to use the edges as arguments for a fillet operation. How could I query this? I have…
-
A one-shot script that populates a feature tree
Hi Everybody! I had already touched upon this subject but there was no way to implement it. Let me remind as discussion was carried out: Is there any way to write a script that could call features in the particular order(i.e. by scenario)? I know that I can just create another feature and call all functions (custom…
-
3D and 2D points not matching
Hi all, hope you had a good Christmas and Happy New Year! I have encountered a problem yet again with my mortise and tenon script. I used the worldToPlane() function to use as a reference point for skRectangle(). I debugged the 3D point and added vectors to get the correct width between the two points and that works. The…
-
Trouble Patterning a FeatureScript
Hello all, I've been working on a new FeatureScript, and have it mostly working, but now I'm having a little trouble getting it to work with the Pattern tool. I found the "getRemainderPatternTransform()" and "transformResultIfNecessary()" functions and have added them to my code. Now when I try to pattern my feature, it…
-
FeatureScript Editable Sketches
Is there a way to generate Sketches in FeatureScript in such a way that they are editable? with the newSketchOnPlane() and skSolve() functions I get an immutable sketch. Thank you very much.
-
What's a complete API call to /partstudios/../featurescript look like?
I think I have all the puzzle pieces for making an authenticated api call to evaluate a featurescript function, but I'm having trouble with cryptic error messages like "Error in input". I get the same error if I make the call via the API Explorer (using API key/secret) or from command line (using OAuth). Here's the raw…
-
BOOLEAN IN UI
I have 2 boolean selection in UI. How to inactivate other boolean if user selected other one?
-
"UIHint" : "HORIZONTAL_ENUM"
Can somebody show me how to use this?
-
Manipulator Please explain
This is an FS library sample code and I tried testing it . I commented out line 57 to 64 but it doesnt change the UI and no error too. Why? https://cad.onshape.com/documents/62ab169994fa64d9d0d8e435/w/96ebcb0923327e87598444ba/e/bcf5593610f1bb81dc98d486
-
Plane Question
This cant be extruded because of evOwnerSketchPlane Do I have to create a plane for this?
-
worldToPlane Question
How come my skrectangle didnt produce a 1x1 inch size using worldToPlane ? https://cad.onshape.com/documents/583340f98c282b104bd800ee/w/b3c16d2af1095e95dd57d4c2/e/91ff8b48a67360edfc87cbd1
-
evDistance for plane and a point
Can i know the distance between a plane and a point using evDistance?