featurescript
Discussion List
-
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?
-
Project/Convert line in FS
can FS use project/convert line?
-
Vector coordinates help
Hello all. My mortise and tenon script is still a WIP and I have ran into yet another problem. I am using the corner of a rectangle as the reference point for an skRectangle() function. Suppose the coordinates of the corner are (-50, 50)*mm in the x-z plane, and I want to put a point that is 10mm across and 5mm down, I…
-
question mark meaning
what does a question mark means in FS coding?
-
Does Onshape have an automatic constraint functionality similar to Inventor?
So, let's say you've got a complex .dwg that you just want to import because you're too lazy to simplify it... in Inventor you'd just autoconstrain the whole shebang and you're off to the fully-defined races... and can delete constraints as you need later on. Anything like that in Onshape, and if not, might it conceivably…
-
How do I get the FeatureScript Beams to recognize the new profiles that I creat?
I made a copy of the Beams script (named it FeatureScript ModifledBeams), Added the profile for 1" X 1" to the profile list, changed the "beamProfileTable" constant to "beamProfileTableMod" in both the beam profile and beam feature tabs. When I load the ModifledBeams into the document it does not show the 1X1. If I open…