-
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 ?
-
How do I create a Part from a set of vertices/faces in FeatureScript?
I want to be able to create a solid part from a set of mathematically computed vertices. I know how to associate the vertices into faces that form a closed volume, but I'm unsure of how best to use feature script to generate the solid. Fumbling about trying things, I have found that I can generate the points as a set of…
-
Simple Polyline Sketch Example on Selected Plane
I can't find a Featurescript example where the user picks the plane or face in the precondition area. All the examples I find use the "TOP" but I want to select one of the datums or an existing face to create my canned polyline logo. Help!
-
Is there a way to set a Property with the name of the FeatureScript a part was created by?
I have a featurescript that produces different parts, and I usually apply it multiple times in one part studio. When exporting the BOM it would be great to have a Propertiy that tells me with which FS a part was created (e.g. "script name" 1, "script name" 2, "script name" 3 etc.) Is there a way to add this as a property…
-
Is there any way to find eye vector?
Hi @NeilCooke Is there any way to find an eye vector (a vector perpendicular to the screen) using featurescript?
-
Why are my variables not working when set for feature driven pattern
I have the following profile designed using a variable width In my custom feature I have tried the following annotation { "Name" : "Profile", "Filter" : SketchObject.YES, "MaxNumberOfPicks" : 1 } def.profile is FeatureList; ... setVariable(context, "width", 115 * millimeter); applyPattern(context, id + "sk0", {…
-
Is it possible to write a featureScript that deletes parts depending on their name?
I didn't find any query that depends on the name of a part, so I was wondering if it is possible to delete parts depending on their name with a FeatureScript? Thank you, Timo
-
Is it possible to export numbers from a FeatureScript?
Hi everyone, I'm trying to calculate a couple of values (e.g. distances) with a FeatureScript and then export them (to a type of file such as .csv, googleSheets, .txt) Is this possible? Any help is appreciated! Cheers, Timo