-
Allow selection of only flattened geometry
I hacked together a Featurescript based on smPerforateBend but with simple holes instead of slots to better suit my application: Bend Holes I also added an option to 'suppress' holes that are too close to a reference edge/vertex. The issue is this only behaves appropriately when selecting geometry in the flat pattern.…
-
dumb question from dumb user about making clone of featurescript
The short question is: Can I clone somebody else's featurescript and rename it so it is easily searched (and found) by my younger students? long version: I run a school technology workshop where any kid in the school from age 5 to 18 can pop in and work on any project that inspires them. The vast majority of the projects…
-
PSA - New FeatureScript UI Options
Onshape recently updated the UI precondition parser, which unlocked some new options for specifying UI. Since it seems these changes didn't make it into the changelog, I figured I'd make a post highlighting some of the new additions: * Group parameters can now be driven by Quantity parameters. This results in the group…
-
Linear Mass Custom Property via FeatureScript
I have successfully created a few lines of FeatureScript to take the volume of a 100mm long extrusion and output the volume per metre (including changing the units) using evVolume. I want to do the same thing with mass per metre, but it appears evApproximateMassProperties requires a hard-called density, even though the…
-
Referencing cut list information in assembly drawings and Onshape BOM
Prefacing this with being only a couple weeks into actually using Onshape I have a number of parts studios that use featurescripts to produce a cut list with information we want to show on PDF shop drawings. It's pretty straightforward to insert just the composite part created from the frame tool (etc) into a drawing and…
-
Query for entities to boolean
Hi, I'm trying to boolean subtract bodies created with oppattern inside a for loop. Not sure what I should do... Thank you! doc: https://cad.onshape.com/documents/ef3ba98102efc6b4e4c71194/w/50cf1b58a05a4b7c535589fd/e/8c530af3038d5e69dbf7c755 for (var i = -1; i < definition.numberOfHoles - 1; i += 1) { const…
-
Measuring Flat Patterns?
I'm trying to figure out a way to model a flex circuit in its bent form and by controlling a dimension, end up with the flat pattern having the correct length. I can get something by trial and error which is close enough (a path length measurement in sketcher sure would help here). One frustration is that the custom…
-
FS generated sketch to be accessible in Asseblies
Aloha All, I am trying to write a FS that generates a sketch that is accessible from within Assemblies. What I am seeing is that a feature is generated with the sketch I have devised but this "sketch" isn't available to insert into an Assembly. Is there a way to create a sketch in FS that shows up as an actual sketch…
-
ACCESSING/CONTROLLING ONSHAPE FROM AN EXTERNAL PROGRAM (Python script for instance)
Hello, Is it possible to access Onshape through an external program, perhaps something written in python? I am working on a FeatureScript that generates a solid from a .csv file with vertex data. My goal would be to automate the whole process by having a python script; 1 - generate/update the .csv file (independent from…
-
Pipe Hole Feature gives the resulting part with a hole different IDs
I created a Pipe Hole feature that allows selection of a pipe part or a feature that created a pipeline and then also select a wall to penetrate. The feature creates the hole so there are no interferences between the pipe and the wall and it eliminates any wall that was inside the pipe. The problem is that the id of the…
-
Dividing an edge in featurescript
I want to place a specified number of sketch points on even intervals along an edge in featurescript. I have done the slot tutorial but i need more understanding on these subjects:Determining the length of an edge in featurescript placing an sketchpoint on the edge in featurescript. It would be great i i was able to extend…
-
Trim previous sketch entities with FS?
I'm working on a feature that—among many other steps—copies and trims some existing sketch curves. I want the output to look and behave just like a normal sketch entity. I'd asked previously about whether we can do something like "use" to convert an existing entity into my sketch that the feature is making (was told no).…
-
FeatureScript naming complete parts
Moving on to assembly I was renaming the default Part 1 value of everything. Question or request to rename a completed part, for example in the brick or spur gear, it creates a finished body, the default Part 1 isn't very descriptive. Granted it could be subtracted to get the negative, but including/adding that subtraction…
-
How to select the same face of a copied part with opPattern?
A quick question, the user selects a face and I make a copy with opPattern of that whole body to manipulate. I want to select that same face on the new body. How can I do this? I tried qMatching, qAdjacent, etc. No luck.
-
TooTallToby Material new Featurescript
*Texte en français au bas --------------------------------------------------------------- Hi everyone! I just created a new version of the FS "TooTallToby Material" where you can see mass in both units (grams and pounds) at once. Now you can change only the length units and skip the mass units change to find the correct…
-
Feature Scripts: One large script, or Several small scripts for variables across multiple documents
I'm using scripts to make variables for every aspect of a huge project (Over 2000 variables and counting). I'm wondering if there's any performance difference between having all of these organized into 3-4 script files or 20+ script files? Some background: I'm designing a large structure that I've been working on for 4…
-
Why can't I pass a value with units to an opThicken
Why can't I pass a value with units to an opThicken unless it's passed in as a variable from function parameter definition: https://cad.onshape.com/documents/c8eef2271809c4293325c9b1/w/d82cceae829e190d1649e512/e/287a2ff37d6f3ee70d59456f (for onshape team only). see line 61 to 69 and note that this all works with no errors…
-
Slide Bézier Control Points?
I managed to create this using a bunch of constraints which I suspect are not generalizable, but here's the concept: I've seen in other CAD systems that there are tools to "slide" the control points along a Bézier in a way which creates as little change to the shape of the curve as possible. I've looked around for research…
-
How to accept wonky strings as featurescript inputs?
Hi! I'm writing a Featurescript that will (hopefully) take an SVG string input, and parse it/convert it into Onshape sketch features, letting users essentially import SVGs through a configuration input. (This would let you integrate configurable logos into your designs, where a user can just upload an SVG in string form,…
-
Reset Name of part
How do I reset the name of a part so that I can configure it using featurescript? EDIT: Also reset any of the other properties.
-
evCollision Clashtypes?
Okay so I'm playing around with the evCollision command but it seems odd to me that there is 8 "clashType" enum values but no matter how I arrange my tool and target bodies I can't seem to get all 8 outputs. So far I've figured out how to get: INTERFERE, ABUT_NO_CLASS, TOOL_IN_TARGET and TARGET_IN_TOOL. For some reason…
-
FS Modifiable Body?
What according to feature-script is a "Modifiable Solid Body" ? This is used in "qAllModifiableSolidBodiesNoMesh()" and "qAllModifiableSolidBodies()".
-
transformResultIfNecessary?
transformResultIfNecessary(context, id, remainingTransform); I've noticed this line of code in a bunch of the std library (31 of the 192 tabs). I don't remember this being all over in the past. Reading in feature.fs there's a large comment about how it enables feature based patterns. Are there any tricks to using this line…