-
skArc/Constraint syntax and radius calculation error
Hi! So I'm trying to create a custom feature and i've found a problem where i try to create an arc using 'skArc' and later define it using 'skConstraint' with '"constraintType" : ConstraintType.RADIUS' but while the original points defined in "start" and "end" are correct in the part studio the "mid" point and therefore…
-
toString in Description?
I'm trying to give a tooltip for a UI parameter using the description and I'd like it to show the range. I know if I enter a value outside of the boundsRange it will show the range automatically, but it would be nice to have some hint of what that range is without guessing. It seems like creating a const or inlining the…
-
Can't figure out CANNOT_RESOLVE_ENTITIES from opBoolean
I've been going through the FeatureScript Fundamentals course in the learning system, and I'm on the final exercise. I'm getting a CANNOT_RESOLVE_ENTITIES from a opBoolean call, and I can't figure out what going wrong. I've more than triple checked my code against what's provided in the instructions, and I've added debug…
-
SET COLOUR, MASS, AND CUSTOM PROPERTY OF GEOMETRY CREATED BY FEATURE IN ONE GO
I have modified the standard sheet metal model feature to be more straight forward for me. If I select a particular material in my custom sheet metal feature, at the moment it sets the thickness, inner rad and kfactor to the appropriate values. Would be create if it also could set the colour, mass and assign a string to a…
-
Split Part using Ruled Surface?
I've been working with some laser cut tubing recently, and have had to go back and forth with suppliers about normal-to-surface tube cutting that doesn't exactly match our model. I've found guides for normalizing coped and mitered cuts on round tube, and used them to come up with a process for transforming a tube modeled…
-
New Custom Feature: Standard Bearing
I needed to chuck an MR63 bearing into a project I was working on, and got a little sidetracked. Built a custom feature to generate deep groove bearings for basically all ISO standard sizes. Includes the following bearing families: 6000 series 160 series MR series MF series 600 series F600 series R series FR series in…
-
Custom Feature: Dovetail Joint
I've developped a complete custom feature to help 3D printing assembly design. Dovetail Joint Created By: Nicolas Barret Link: OnShape document link A custom FeatureScript that generates male and female dovetail joints between touching solid bodies. Tailored for 3D printing assemblies, it automates the boolean cuts and…
-
Custom Feature: Triad Transform
-Link to feature up front- Onshape's vanilla transform feature doesn't give you those nice buttery smooth rotation handles to play with like the assembly tabs do, which is a shame because some of the most aesthetically pleasing structures aren't confined to the bounds of XYZ coordinates. I mean look at these crystal…
-
[Chatbot Copilot] - We Built a FeatureScript AI Assistant That Outperforms ChatGPT
Hey everyone, I’m a mechanical engineer, and I’ve been working with FeatureScript at my company for about a year now. Honestly, it’s been tough. Tools like ChatGPT suck at FeatureScript, which is frustrating when you know how useful they are for more familiar languages like JavaScript or Python. Unless you're a…
-
Classify Onshape Standard Content in FS?
Hi everyone, is there a way of creating a query to determine if a part is Onshape standard content in FS? I think there must be some kind of undocumented, internal "standardContentId" or something like qGeneratedByStandard because somehow the standard icon in the feature tree has to be added to these certain parts in the…
-
Given a mate connector how do you find the owner body for it?
How do you go from a mate connector to the owner part? I tried qOwnerBody(mc) but that seems to return the MC itself since MC's are bodies in their own right. annotation { "Feature Type Name" : "OwnerOfMC" }
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map) precondition {…
-
Is it possible to use feature script to quickly export mass property values for assemblies?
Hi all, Still learning about feature script but I wanted to know if anyone has had any experience using Feature Script to export/output data (specifically mass property values like mass, center of mass, and moment of inertias) into either the command line or ideally into a txt file for an entire assembly. This action would…
-
FeatureScript Standard Library Visualizer
https://gatrall.github.io/fsvisualizer/ I built a tool (or more accurately vibe coded a tool) to visualize the Onshape Standard FeatureScript library. This is very new, and I'm sure there are some weird things about it. Let me know what works and what doesn't. For each module, it shows what's imported/exported, a link to…
-
Custom Feature: Design Intent
Link to Design Intent During design reviews I am often asking or being questioned as to why a model was formed the way it was. Usually the answer is in someone's head or personal notes and lacking from any formal documentation. If it is in documentation, then it is likely far from the CAD (unless you keep that in Onshape…
-
Temporary Items During Edit?
How do first party features do things like "Show isocurves"? Is there a standard way to draw stuff without debug() or manipulators that disappears when not editing?
-
Applying bend reliefs to vertexes between rips and bends?
Working on yet another sheet metal script and I'm really close to completion on a build that's ready for deployment but I'm having issues getting bend relief geometry to generate on the ends of my bend segments of sheet metal parts. I suspect my issue is that I was trying to apply bend relief attributes to corners that are…
-
Extrude up to body, up to face, booleans, performance
With Parasolid and FeatureScript performance in mind, I'm trying to figure out the best approach to creating a lot of features which a normal user would use "up to next"/add. As a regular CAD user, with things like bosses and ribs on injection molded parts, whenever I've been working complex models for a while, each…
-
ChatGPT Atlas for FeatureScript vibe coding
OpenAI has introduced ChatGPT Atlas, which is their own web browser with built in ChatGPT agent functionality. So far this is MacOS only, but Windows is in development. https://openai.com/index/introducing-chatgpt-atlas/ What this means potentially is that you can use ChatGPT to vibe code FeatureScript. So far I'm not…
-
Toggling Modes Updating Stored Values?
I'm reworking the standard Trim curve feature. One trick I'm trying to make work is to allow the user to trim/extend "up to entity" and then switch to "blind/distance" mode where the value of that blind distance comes from the up to entity, but now it's draggable/editable. As an example, let's say I've blind/extended a…
-
Use Report, viz(), and dbg() for conditional println and debug visualizations
Earlier this year I wrote a utility called "Report". The one-sentence description is "Conditional debug visualization and println controlled by feature and not by code". Here's an intro video: https://www.youtube.com/watch?v=Eu7puEa8Oak You can find the feature and functions here:…
-
Tapered Recess Creation?
I've been struggling with one aspect of a molded boss feature I'm developing. I've tried a lot of different ways to solve this but getting a general case method that is robust is surprisingly challenging. I'm working on a molded boss feature to rival hole.fs in complexity which takes basic choices for screw type/size and…
-
Auto part marking scripts?
A common request from my team is the want for a script that automatically generates part names or numbers and etches / engraves the text into the surface of the part somewhere so that our fabrication team gets easier puzzles to put together and the drafting team gets to spend less time writing puzzle solving instructions.…
-
Does anyone have any good examples of how to use startTracking?
I've read a few posts on the forums, but would like to see some examples on how to use it. My dumb brain is failing to understand how to implement it in practice.