-
How do I set the "MaxNumberOfPicks" with a query?
How do i set the max number of picks with a query? precondition
{
annotation { "Name" : "Group Size" }
isInteger(definition.quantity, POSITIVE_COUNT_BOUNDS); annotation { "Name" : "Parts", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
definition.parts is Query;
}<br>
-
How to calculate the farthest point within a piece?
I would like to know if there is some kind of Feature Scripti capable of searching the furthest path of a flow of plastic material injected into a part. (I hope I have explained myself well :) )
-
custom msg for undefined table cell
For FS tables, does anyone know if it is possible to replace "Not set" with a custom message/value?
-
How to find intersection points for some entity types in FS
Any leads how to find in FS: 1- WiredBody(Spline) - WiredBody(Spline) intersectionPoint; 2- WiredBody(Spline) - Plane intersectionPoint
-
Pattern point to point help?
I'm trying to transform copy a selected face from one point, to another so that I can use it in multiple places. I keep getting stuck on opPattern or transform. Can someone help me understand how to do this? Here is what I have so far. The opPattern is where it breaks. var count = -1; for (var edges in pathFaces)
{ count =…
-
opExtrude UP_TO_FACE Issue
Hi there, when I opExtrude as per below if the regionToExtrude is within the boundaries of the bottomface, it works ok, but if the regionToExtrude is outside the boundaries of the bottomface it doesnt work, is this expected behavior? opExtrude(context, id + "extrude1", { "entities" : regionToExtrude, "direction" :…
-
opMoveFace distance & direction?
I'm trying to move a face 1" in the direction of the zAxis of the csys that I created. What I have now moves it 1" from the world origin... How do I do this? opMoveFace(context, id + "moveFace1", { "moveFaces" : faceToMove[5], "transform" : transform(-toWorld(selectedCoordinateSystem, vector(0, 0, 1) * inch)) });
-
Topographinator (Update)
Topographinator Link https://cad.onshape.com/documents/af87f92a8aacda9b29d58899/w/895817513a38f6bc735f701b/e/4782d8b17fc1f4ca112070c4 Created by: Michael Pascoe, Cache River Mill. Description: This custom feature extrudes your sketch into multiple layers. Prerequisites: A single sketch containing 3 or more fully enclosed…
-
For loop, sum up to the current loop?
Is there a way to sum up to the current loop? The loop calculates an angle, I need the n'th loop to add up all of the previous loops angles. for (var i = 1; i < nSegments; i += 1) { var = sumOfPreviousSegmentAngles = var segmentAngle = atan(d / sqrt(i))/degree; }
-
How do I use the other faces found with qFaceOrEdgeBoundedFaces
Hello, I have selected my inner face, I also selected a boundary. The query found 3 faces between face 1 and the boundary. How do I know what to call the other faces that the query found so that I can use them? I believe qUnion keeps them in order, but I'm not sure how to use faces 2 & 3 that the query found. Code: var…
-
PointsManipulator visual feedback
I'm using pointsManipulator's in a FS. The way I'm using it is to allow the user to toggle the selection of a point. So the count of the points the manipulator refers to is always 1. When this point is unselected, which it is initially, the "index" of the manipulator is set to 1, and the single manipulator is drawn as a…
-
Featurescript to create plane from an edge and a direction
I'm only just learning about Featurescript. This is (a step towards) what I want: from an edge, create a plane that contains the edge and is vertical. Here is my attempt. I've tried opPlane, but that requires a point and a normal. I don't have the normal (yet). I've tried cPlane (seems like a logical choice, this what I…
-
Can no longer take Entire Part Studio as parameter
Relevant scriptWhen the "Place Hole Profile" script "Part Studio" parameter has a filter of only ENTIRE_PART_STUDIO, then attempting to use this feature and selecting a part studio will simply report "No entities or features available." If I add any other item type to the filter (eg PartStudioItemType.ENTIRE_PART_STUDIO ||…
-
Speed when instantiating many parts
Hi everyone, I have a featurescript which instantiates many parts and is therefore running slowly. I tried grouping the parts into closed composite parts, so instead of e.g. 1000 parts, I would have 100 composite parts. However, this does not significantly increase the speed (neither the actual speed nor the calculated…
-
How to handle mouse-hover events using featurescript?
Is it possible to write custom-featurescript to handle mouse hovering events? Just like draft analysis display as shown below: I'm working on custom feature that does some analysis and the idea is to display results in the viewer while user moves mouse on the face. Any idea would be greatly appreciated. Thanks, Nathaniel
-
Laser Joint FS cutouts penetrate both walls of tube?
I have successfully created pins and cutouts on tube joints, however i cant find a way to prevent the cutouts from extending right through the far wall of the second tube. See example https://cad.onshape.com/documents/7b1fcf924bc3bd3b89b96777/w/702e3f28adb5dedf3c2d04c3/e/bc9a81099715333be1df8ed5 Am i overlooking something?…
-
Fillet edges only on faces in extruded direction
Is there a query that will give me only the edges on a body that are in the extruded direction (i.e. perpendicular to the sketch plane)? I don't want to fillet anything on the end faces. Queries are still a little bit of a mystery to me. This seems to work if I just extruded a body: var ExtrudedEdges is Query =…
-
OpFillet for creating corners
All, Can we use opFillet to create corner between two intersecting curves(both on same plane)? I am aware that sketch is an option but i don't want to use it as sketch cannot adapt changes in intersecting curves. Please share your views. Thanks.
-
O-ring Groove Custom Feature
With the recent release of O-rings in standard content I created a custom feature for adding the o-ring grooves to your parts! Add a radial or axial groove and the feature will autosize to match the geometry. A mate connector is also added for easy mating in assemblies. Add it…
-
Is it possible to make a part transparent, that has been (manually) assingned a color previously?
Hi, I have a part studio with multiple parts where I set the appearance(color) manually. Now I'd like to change the transparency of some parts depending on certain conditions using a featureScript. I found out, the manually set colors cannot simply be changed, but is there some way other way to change some part's…
-
FeatureScript Sculpt Surface
Hello, I play with FeatureScript Sculpt Surface to modify a cylinder. The modifications are hand made. Is there a way to copy this result so I can make the same modification to others parts ? Or to save the parameter Vectors ?