feature script
Discussion List
-
Custom Feature: Gear Rack
Realized I needed to design two gear racks for a robotics project, and rather than spend 20 minutes doing it manually, I wrote up a custom feature to automate it with some quality of life features (helical/herringbone teeth, fast regeneration, alignment stuff, blah blah blah) Snag it here if you'd like! 100 tooth regen…
-
Issue Assigning Value to Company Custom Property
I attempted to create a feature script, and when trying to use it, am getting regeneration errors. Our company uses mechanical cables. For these mechanical cable parts, I want a 'Cut Length' property. These parts are modelled using sweeps, and I want the cut length value to be linked to the sketch entities used as the…
-
Anyone already wrote a feature script for "slotted bending" (sheet metal)?
Hey, I am currently trying to write a quick feature script to transform a sheet metal bend corner into a "slotted bend" (like described nicely over at Hackaday a while back: https://hackaday.com/2016/05/18/the-art-and-science-of-bending-sheet-metal/ ). This can already be easily done manually by drawing a sketch with a…
-
How do you add in a Feature Script into OnShape, ie; Surface Text?
Hi all. I'm somwhat new to Onshape and went through a class to learn it but have come across a situation that I can't find the answer for. I'm sure it's a simple one that just wasn't explained in detail to our class. What I am trying to do is add a text box with text in it in a half moon flat configuration somewhat like…
-
Extrude along a line featureScript
I'm trying to create a feature that allows me to easily create print-in-place hinges for a personal project. One of the features is that I can define the angle the hinge is created at. how can I edit my script to make the extrudes occur along the same path as the line given? Here is the document:…
-
linear pattern direction
hey guys , i am having some trouble with how my linear pattern is generating in a way i cant understand. the feature is in early stages, but the point at this stage is to select a 2d face to run a set of rectangular load bars either along an x or y direction . using a bounding box to get the length of the bars as the shape…
-
Creating Sheet Metal Object via Feature Script
Hi All, When I create a sheet Metal object via feature script. In the sheet Metal Context window, It shows "Unknown" instead of the usual "Sheet metal model 1"… How do we control this behavior in featurescript? Thanks in advance!!!
-
opBoolean() with BooleanOperationType.INTERSECTION fails with @opBoolean: BOOLEAN_BAD_INPUT
Hello Helpful Onshapers! I want to use opBoolean() to "take a bite" out of a solid model. I imagine that this should be done in two steps: 1. Use BooleanOperationType.INTERSECTION to create a "mouthful" of the target 2. Use BooleanOperationType.SUBTRACTION to remove that mouthful I then plan to put the body created in step…
-
Extrude problem within a loop
I try to make a feature script that takes a json file with parameters and executes some extrudes in a for loop. That works until a certain index, where it crashes with a EXTRUDE_NO_SELECTED_REGION error. If I instead create new parts, it finds some regions.…
-
Issues about the feature scrip to generate a parametric curve
Hello, I'm an amateur designer using the Onshape platform with very good results so far, I must admit. However, I've recently run into a problem I can't solve. I'm trying to generate an involute profile, and when I load the data, I get an error message. To explain, when I write the equations for X and Y, I get the error…
-
Feature script extrude offset issue
Hi, I would like to know how I can make an extrude with an offset within a feature script. The link below points to an example project with a failed offset extrude. The parameter "hasOffset" is set to true and the "offsetDistance" is set to 5 * millimeter. The feature script generates without error but also without offset.…
-
New FeatureScript: Mold Guide Pins
Hi everyone, I made a new featurescript to create pyramid and hemisphere guide pins for 3D printed molds. I based the functionality on the hole tool, where you just have to select points. Add points to the parting surface and then select them to add and subtract guide pins from each side. Link: William's 3D Printing…
-
Getting name of derive that imported parts
Hi, I'm very new to featurescript and I'm making a simple cutlist table which is working. I'm deriving my parts (for example cabinets) from a configured library part. I would like to be able to get the name of the derive feature that imported the parts so I can prepend it's name to the actual part name on the body. Any…
-
Two bowls with almost the same dimensions
I want to create to different rectangular bowls with almost the same dimensions. They differ in shape and length and width and depth. The remaining dimensions like thinkness, spacing and liddepth are the same. I drew and formed the first bowl. I wanted to use the same variable table for the second bowl. However I got…
-
any "unique sculpting" scripts?
I've been on the lookout for scripts that can add "uniqueness" or "life" to some models. To explain my question: This is "wood grain" script (mainly used to "show" that a part is "wood-like") But if you don't use it for its "Intended Purposes" you can make intresting models… If you know any script that have such…
-
Custom Features Collection
I joined the Onshape design team in January of this year, having previously worked in NX for 11 years. At first, I was hesitant to get to know the software, but it quickly became apparent that beyond the built-in functions, there are also many custom solutions for different tasks. These are nice, but it is almost…
-
Mapping faces from a plane onto another plane
I'm trying to make a function that "wraps" a plane onto a plane or onto a curved surface. It works for curved surfaces : const targetWrap is WrapSurface = makeWrapSurface(context, definition.target); const sketchPlane is Plane = evOwnerSketchPlane(context, { "entity" : definition.faces }); var result is Query = qNothing();…
-
How can I copy errors and warnings?
Newby to FeatureScript and using ChatGPT to help out but one thing that's driving me crazy - warnings and errors appear as "floating" text boxes meaning they only appear when I hover over the error and disapear when I move my mouse. This makes it impossible to "copy" the error and paste it into a browser. Is there a fix…
-
How do we find useful feature scripts?
@Jake_Rosenfeld posted a very helpful article about adding FS at the end of this discussion Jake or others - I have seen this question on forum before but I do not remember a good answer. I know FS is not intended long-term solutions to generally required functions. However, for now there is a lot of good stuff which we…
-
qEdgeVertex suddenly missing – related to default libraryVersion?
Hi everyone, I'm running into a frustrating issue with FeatureScript inserted via the Onshape API (from a Python-based workflow). Recently, my script started failing with an error saying the qEdgeVertex function is undefined. After some investigation, I found that the root cause seems to be the libraryVersion — it's being…