featurescript
Discussion List
-
GERBER to ONSHAPE feature
I recently got into the world of PCB design. It’s going well, just had my first PCB made and it’s working great. I’m working on KiCAD, though that’s not really relevant to the issue I’m about to surface. I want to develop a FeatureScript that bridges the worlds of PCB design and 3D Modeling. Such features already exist…
-
How to have a Sketch as a parameter
I’m not sure I’m getting the terminology correctly, but when I’m saying parameter I’m referring to the light-blue input boxes that are in the feature-menu that pops up when creating a new feature. Say, in a Part Studio, I creat a new Extrude feature. I can either manually select entities to extrude (with my cursor), or I…
-
@OPPATTERN: INVALID_INPUT
FeatureScript 2345; import(path : "onshape/std/common.fs", version : "2345.0"); annotation { "Feature Type Name" : "Pattern Line"} export const patternLine = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Select Line:", "Filter" : EntityType.EDGE,…
-
@opPattern: INVALID_INPUT
Trying to duplicate a user-selected line. No idea why these two Featurescripts attached below aren't working. Out of ideas. @NeilCooke HELP! Also, side questions:1) What's the best way to have the pattern be perpendicular to the line? Currently they're in the same direction. I was hoping to be able to go…
-
(FeatureScript) help with checking the form of a face
I'm working on a FeatureScript tool that operates on cylindrical holes and the flat face of counterbores (in different modes) and am having trouble finding a good way of checking the form (cylindricity, flatness) of the queried faces in question. What would be the most efficient way of doing this?
-
Reset material so featurescript can modify it?
I have a lot of bodies which have had their material properties edited interactively. I've now created a featurescript to change the material properties with setProperty. However this doesn't work for bodies where the property has been changed interactively, even if the material is reset to "None". Is there any way to…
-
How Do I Reach Out to FeatureScript Dev?
I am attempting to bug report for FeatureScript's Point Pattern but am not sure how to reach out to any devs since I cannot find anything online or on featurescript docs. Any help would be appreciated!
-
New custom feature: Make radius
Continuing my practice writing featurescripts I figured I create this feature that I used to use in another CAD system and sometimes missed. It's similar to a Move Face (offset) but sets the round faces to an absolute radius, rather than a relative offset. have fun! Jelte now available for testing for all:…
-
Keep a reference to a body across operations
I've been stuck on this for a day now. I'm creating a feature to assist making Domino joints in wood panels. The panels will initially be modelled as overlapping, and the feature will do boolean operations to remove the overlapping parts, and then create sketches on the parts that will show where the Domino router will be…
-
Get a Vector from an Edge
Is there a way to convert an edge (query) to a vector? I've asked Chat GPT but it just seems to make stuff up... "Hi, Chat GPT here, In Onshape FeatureScript, you can convert an edge to a vector using the opEdgeToVector function. This function takes an edge as input and returns a vector representing the direction of the…
-
Table (New Custom Feature!)
Table (New Custom Feature!) https://cad.onshape.com/documents/01485b6de17aef414a25e778/w/926dfaef6b63d239b8d9d739/e/fb5da00aa581ddc9c53c4379?renderMode=0&rightPanel=cutlistPanel&uiState=6398b9684c6d6f30a465a5b1 Table allows you to: * Import CSV data * Manually input data * Store data as a custom table * Store data as a…
-
Featurescript. Create a record of edges vs solid bodies.
Can the keys in a map be edges? And can the corresponding value in the map be a Solid Body? (I know that Arrays can contain Solid Bodies.) I want to create a record (whether it's a map or an array) that links an edge to a body. So Edge1 belongs to SolidBody1, Edge2 belongs to SolidBody2, Edge3, belongs to SolidBody3 etc. I…
-
New Feature: Split with Flip
A problem I've repeatedly encountered is that splitting a part doesn't offer any way to control which resultant part maintains continuity with the original, and which is considered a new part. This feature is similar to the regular "Split" tool, but adds a "Flip orientation" checkbox to swap which created part is which.…
-
Help Point for Split in FeatureScript?
Hi, I'm working on an alternative split body feature that first creates a copy of the part and splits both of those so attributes/properties and ID's are more stable in referencing their part (original or new). This is relevant for 'keep both sides' splits. I've often had a upstream feature of the split tool change…
-
Feature Script simple question
Hi, I'm learning Feature Script these weeks but i'm a newb to programming. one of the custom features i created selects and edge (by user), and then the edgelenght is evaluated and used in many places. it seems that the definition of the edge or a value created in the 'precondition' is available for all function calls…
-
Setting the Name Property on a Composite Part
Perhaps this has come up before, but is there any fundamental reason I shouldn't be able to call setProperty for the name on a composite part? In other words, should I submit an IR to do so?
-
New FeatureScript predicate: Fontpicker
I have published Fontpicker R1. You can find it here: https://cad.onshape.com/documents/0fef4e86805ae7e232be4d16/v/1decb6f4e1ef91711d5892a6/e/4522968d16630da6fe5ce8b8 Please note: This document doesn't define a feature itself. Rather, it defines a predicate to be incorporated in to your FeatureScript preconditions. This…
-
Retaining Ring Groove Custom Feature
Easily create grooves for ANSI and DIN retaining rings with my new Retaining ring groove featurescript. Simply select a cylindrical face and a mate connector for the groove center and it will automatically find the matching groove size. Add to your toolbar here (no need to…
-
Single Part studio Custom Table Examples
I'm trying to write a custom table featurescript for a single part studio with a composite part. It is essentially a cut list but I am trying to use variables in the part studio to drive the length for the different cut parts instead of frame tool elements. I'm also trying to write some logic that will change the…
-
How can I use FeatureScript to get the longest edge of a part as a computed property
I try to create a feature script that lets me get the longest edge of a part as a computed property in a user defined table.So far I had no success other than get the compuedVolume as shown in an example somewhere. Can yomebody give me a hint or an example how to get all edges, find the logest and rturn that as a computed…
-
Sensor Custom Feature
Often in the design process there may be specific geometric constraints on the parts that need to be considered along the way. I created this Sensor custom feature to measure certain geometry and compare it to a specified value and warn if it is out of spec. Currently only edge length and fillet radius are supported but I…
-
Advanced Non-Uniform Scale Feature
Here and there I've seen threads or posts about the need for a non-uniform scale feature. I've written a little feature in FeatureScript capable of scaling in any chosen direction or set of directions. Choice between: * Uniform scaling; in the standard coordinate system * Non-uniform scaling; in the standard coordinate…
-
Featurescript to add heat-set threaded inserts
I use a lot of M3 heat-set threaded inserts in my 3Dprints but it takes several hole operations to generate the type of geometry I need. I haven't really created a featurescript before, but I think this would be a good use-case to simplify my workflow. What I'd like is to be able to specify a somewhat complicated hole type…
-
how to get the coordinates from all parts? loop through all parts en print the coordinates
Hi, I am not a programmer, but I think I want something fairly simple: I want a list of coordinates of all parts in the part studio. Basically loop through all parts and print the coordinates in the monitor (or save to csv, but that is luxury... : )…
-
Introducing Camel: CAM for OnShape, implemented in FeatureScript
Camel is a CAM application for OnShape, implemented in FeatureScript. Use the Camel FeatureScript library to generate tool paths from a PartStudio to drive a 3-axis machine such as a CNC router. Use Camel’s companion app to download toolpaths or simply copy/paste them from the FeatureScript notices panel. Refer to the…
-
Anyone ever written a feature script that references a .csv spreadsheet of part numbers/descriptions
Hello! We have some standard-ish panels that are assigned part numbers based off of sizing and a few other options. Right now I'm manually entering in the part numbers for the panels based off of the sizing of the panels (which can be time consuming, annoying and prone to occasional errors) I'd like to write a feature…
-
How do I get the parallel distance between two mate connectors?
working on my first script. evdistance is giving me the total distance between two mate connectors, but I want the parallel distance between them (or normal to the first one) https://cad.onshape.com/documents/68cc6e7f44c7d45ead2a1b38/w/5c67626b11109a69231f9606/e/f5a54e138097299817bb6f7b