-
Featurescript: How to create a line between two points (vectors)
How do I create a line in FS between two points (vectors), not using sketch points? since line(point,direction) only offers a direction, would I need to calculate the direction somehow, and how would I do that?
-
FeatureScript: How to query (not in viewer!) points and lines to create planes?
I'd like to create a plane in FS using either: * three points which I create as variables, vector(x,y,z) * meter * a line (more or less an axis, since it seems infinite) created using line(point,direction) and a point how do I query these points and lines so that they can be used? Note that I want to query these in FS; not…
-
Get distance between midpoint of face and edge
Hi there. How would I get the distance between the midpoint of a selected face and an adjacent edge?
-
Plane Axis orientation
@ilya_baran Lets say you have created a plane "Plane 2" as shown below. now as you see the plane created in in the same axis orientation of the Global X and Y axis even tough I have used the edge of the extrude to define the rotating axis. I want the plane to be oriented in such a way that the axis system of "Plane 2"…
-
Multiple use for imported parts
Okay, I'm going to try and explain this to the best of my ability (<--Feel like I've said that before?? :/ ) So I have a profile that I am importing in to a FS..... easy enough... Then, I turn it in to a function. export enum sealantProfileID
{ annotation { "Name" : "1/16 inch" } F72Dq47pUtYbudg_0, annotation { "Name" :…
-
FeatureScript Extrude Help
I'm working on a new FeatureScript and could use a little help. Inside of the script, it is creating a sketch and then using the extrude function to create the feature. I'm using the 'extrude' function instead of 'opExtrude' because I also want the option of adding a draft to the feature at the same time. I want the user…
-
Rib FeatureScript Modification
Hey All, I've made a modification to the Rib FeatureScript and thought I'd share it with everyone. The original Rib feature worked great, but sometimes I need to create two ribs with a specific distance between a face of one rib and a face of another one. It's a lot easier to do this within the sketch for the ribs, so with…
-
Guidance on planeToWorld and auto placing
Hello everyone, I am building on the collaboration of the 'Table Creator' I'm taking it to a different level. This time I am building a wall and placing a picture on the wall. I have most of the code already written, but if you look at what it creates you'll see that the picture ends up out in space..... I know it has to…
-
Target Audience for Help files.
Hi folks. Firstly this is not meant to be a winge although it may come across as such. Sorry for that :) I think you're doing an excellent job with regards to tool tips in the regular interface. (Hover over a button an explanation comes up, hover for longer a deeper explanation is given.) I wonder if there is a way to…
-
Revisioning public Featurescript - Public/Private Versions in one document?
Hi folks. I'm sure this has been covered before but I can't find the post I was after. Sorry if it's old ground. (Question 1) Lets say I have a document containing a FS that I've made public that I now want to develop further. The workflow I envisioned was to have the latest stable revision made public, and with further…
-
Parametric Surface from f(x,y)
I'm trying to build upon the Parametric Curve FS to create a Parametric Surface. The intention is to be able to input a function Z = f(#x,#y) and have that create a lofted surface. However, I'm running into problems getting the z equation to accept 2 inputs (x,y). @ilya_baran, @kevin_o_toole_1, maybe one of you can take a…
-
automate STL Export
I'd like to have a one-click-solution for exporting the selected body as an stl with fine quality, so that I just have to type in a name for the file. sadly, I have no programming experience whatsoever. Has someone already done such a FeatureScript? Thanks in advance!
-
set points coincident
while not satisfied with the dxf import: https://forum.onshape.com/discussion/4356/imported-dxf-problems#latest i would like to try it with a featurescript solution: https://cad.onshape.com/documents/150b4b8582755bae310054ab/w/e7f86ea4d976b93e892239e1/e/ae4e6be500f0024054ffe3f8 first, why will the sketch entities…
-
how to evaluate extrude direction so it can be used in a transform
Hi folks. Hopefully an easy one this time. I'm creating a body using an extrude from a sketch. Having made it I may wish to transform it in the direction of the previous extrude operation. I can use the qCreatedBy query to grab the body for the entity parameter but am having difficulty evaluating the extrude direction for…
-
Using FS can we create a sketch on a face of a part or only on Planes?
Hi Folks. I'm playing with my first FS. Using FS can we create a sketch on a face of a part or only on Planes? More broadly I have an input of a single vertex (from a sketch on the surface of a solid part). I wish to create a sketch here then add some geometry to work with. What's the easiest way to accomplish this please?…
-
Rounding Calculated Variables to Pattern number of Instances
Can anyone offer any tips for how to round off or convert calculated variables to integers so that the calculated variable works for patterns?(number of instances patterned?) Surely this should be fairly simple in FeatureScript but not sure how to approach it.
-
How to using FS to create a quick sphere
I tried using FS to quickly create a sphere but it still not work. where is the problem? thanks https://cad.onshape.com/documents/578f89d3e4b0cdd13940cfe7/w/92807c44d555c353a9b7b4b3/e/d9b77e1c239e6135100324f8
-
Featurescript: Select all outer faces adjacent to a seed face
I've tried all sorts of variations of qLoopBoundedFaces, qFaceOrEdgeBoundedFaces, and qEdgeAdjacent... no cigar. For example, given the start face of an extruded ring, what combination of queries will retrieve the cylindrical outer surface? It seems whatever I try ends up with all the surfaces of the extrusion. This would…
-
Revolved Curve FeatureScript
I've been playing around with the opFitSpline function. One of these days FeatureScript will support on the fly parsing of user entered expressions. In the meantime, this FS will generate some fun 3D curves. https://cad.onshape.com/documents/5780f7f7e4b0b759b32cbbb9/w/6ae742fb5da12d92cd4e4ddd/e/aab0024ce36028e8b6ef4faf
-
Creating a super elipses featurescript
Super elipses for reference: http://demonstrations.wolfram.com/VisualizingSuperellipses/ I'm trying to create a superelipses featurescript, but am having some trouble getting the shape to behave the way I want. The two solutions I can think of are to 1) make geometry and then constrain it (so that the corner fillets are…
-
3D splines can't be extruded or lofted
It seems that 3D splines created in FeatureScript can not be extruded or lofted to create solids with them. When drawing closed curves with opFitSpline I can't even select them in the Extrude command. I am doing something wrong?
-
Display of enum for feature type in custom features
Is it possible to get a feature-type enum to display as "tabs" rather than a drop-down like it does for the native boolean operation? I was able to do this in a custom feature if I declared a BooleanOperationType enum and imported onshape/std/booleanoperationtype.gen.fs at the top, but not if I defined my own operation…
-
FeatureScript O-rings
Made a FeatureScript to automate the modelling of O-rings. Enjoy! Amateur programmer here :) https://cad.onshape.com/documents/ae242486af63d55695d994a6/w/bd934a52d0bc030cc75b310f/e/6393ddee213a083563197321
-
opDeleteBodies doesn't remove outline
Hi, After creating a sketch in FS and (for example) extruding it, I remove the sketch with opDeleteBodies. However, the outline (edge) of the sketch still remains. What am I missing here? You can see it in "Nuts & Bots Generator"…
-
Stopping short with an Extrude Up_To_Surface
I'm working on a feature which will remove material from a model to make a poor man's linear bearing for 3d printed parts. I've managed to construct half of the feature properly, however I'm having trouble removing some additional material from the inside of the hole to reduce friction. In the model attached below (V1) I'm…
-
No functions for line manipulation?
Hi, I've haven't found any functions for manipulation of Vector and Line objects. Something like: var line1 = line(vector(x1, y1), vector(d1, d2)); var line2 = opRotate(line1, vector(p1, p2), 90 * degree); var vector3 = opIntersection(lineA, lineB); Am I missing something or do I really have to write them myself? I know…
-
Problems with skArc
Hi, I'm creating some corners with skArc but some are ending up inside-out! I'm using the getArcMidPoint function posted here earlier. All the small arcs in the picture below should be "outies" and the large center one "innie". Here's the code for the lower left one (ll and ur are vectors) start = ll + vector(0 *…
-
Creating acircular pattern in featureScript
Would someone be kind enough to look at the script in this document https://cad.onshape.com/documents/623b04759dbfa9159178fe48/w/3f75f7adc024168001e48971/e/ebff95d2dd43547b3b99a055 and point me in the right direction to fix the circularPattern. I am trying to make a flange for joining sections of pipe
-
FeatureScript and Assemblies?
Im trying to use FeatureScript to replicate an automated process I have built in Proe using trail file. Id like move the core build process from Proe into OnShape. The Proe trail is building a PCB from an intermediate text file (IDF) that describes the board outline, slots, and holes and also includes the components and…