Does anyone know how to prompt?
my prompt:
add to https://cad.onshape.com/documents/b6e221cb7b4d15cab86f91b1/w/23496d7c6df43ac06d392281/e/dabbb61e3c7c57dd789d41db and an annotation group that accepts 3 length inputs and then create a cube based on these dimensions
I'm really impressed. Now what?
It'd be nice to have some guidance on prompts because I'm obviously bad at it.
Comments
-
Using
/planmode with ChatGPT or Claude is super helpful. It's interesting what sorts of things you may or may not have considered, that an LLM will ask you in order to come up with an organized plan of action.I've also picked up a lot of ideas from various general AI YouTubers:
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
Lately I've been having Claude run sessions with me writing out spec sheets to flesh out the contract for a script with no code written just nailing down what features should do and what inputs and outputs are expected, and having it ask me questions about implementation or filling in gaps in knowledge or intent. It's been pretty efficient to have these pre-code prompting sessions to build the implementation roadmap and not waste code round trips with the agent working on not-what-I-wanted. I've been doing this completely outside of the MCP service with my own offline std mirror to avoid blowing the API budget.
0 -
When ChatGPT "Pro" was not part of Codex, I would have Pro write specs and Codex (ChatGPT 4.x whatever) do the coding. The general idea of having the smartest model help you plan things out is very true. The more background it has about Onshape features, and Featurescript the better. From @Derek_Van_Allen_BD
I learned to set up a clone of the FS library. I also got Chat to build a local copy of the documentation for FS. Both of these are good for pointing your LLM at so it doesn't do stupid things.Also I would think carefully about what you want the feature dialogue to look like. I've spent a surprising amount of time tuning that. I'd love to have a tool - like an interface builder - to prototype the UI.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
1 -
I'd suggest that anyone who is really wanting to learn any FeatureScript should start by learning to manually code the UI. I often find it easier than prompting one if I have much of an opinion about it (an your opinion is one of the main things of value you bring when vibe coding). There are lots of little things it helps to know about with the UI, like when to use maxNumberOfPicks or a certain UIHint. I'll make a UI, and just click around in it, imagining functionality, and that will usually inspire some edits before anything is functional. From there I can just hand the UI precondition to the AI and ask it to wire it up, which also really helps it understand the goal.
1 -
The challenge I have is that I know that a lot of the UIHints or things like maxNumberOfPicks exist, both from use, and from manually coding, but I don't remember all of them. Even with autocomplete, I find myself spending more time than I'd like looking things up (e.g. how do I get it to remember the previous setting for this input?). This is where the LLM is super useful, because I can describe the functionality that I know is available, but the syntax escapes me.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
Equally viable is knowing what you like from other features, pointing the agent at the file you're referencing with the sleek UI and telling it "steal these elements from Evan's thing and repurpose em for this script".
Though I have needed to write a specific set of instructions into my repo about the isButton() button and how none of the other buttons are what I mean when I prompt for buttons. Got tired of telling Claude to steal from Routing Curve.1 -
Prompting is a euphemism. The key is to write clearly articulated language. Logical. Ontological. Removed of all ambiguity. What Evan said is the truth of it all:
IF you do not know what you are doing, THEN the robot will not know what to do.
Do not let the personality wrapper fool you. AI is just a machine. An amazing machine, but still a machine.
I have been blackpilled. Not on AI. On people's ability to use AI. There are so many techniques. Yet, in the end, it's about logical, programmatic thinking and a clear understanding of what you, the owner, want to do.
There is no right way. Tips are: Let another ai write the command instruction after ideating with it. Avoid ambiguous language such as "always" and "never" that carry heavy weight programmatically and effect ai tremendously downstream. Have a basic understanding of logic and logical fallacies. Learn General programming.
But it all boils down to clear thinking and communication.0 -
I definitely need to improve my skills at prompting and wondering how those guys built the featurescripts shown in the launch video. Wow, I wanted that badly.
S1mon thanks for the links, I subscribed to them
Derek please tell me more, I think you're right and moving in the right direction
Evan I totally agree with you
Mark should I be controlling prompts or code? which is more important for a bigger project.
When writing this crappy prompt, I was thinking to myself, I could write a feature script in seconds and why I am I doing this, creating a block, who cares? I just wanted to see if it could do it. I stopped it's 1st try because claude was prompting me for numbers verses feature script creating an annotation with prompts. The 2nd try I watched it's progress which was totally lost in the wood. So, I went and took a shower thinking it would crash. When I returned, from la-la land, to I did it, I have no idea what happen. There was a link that pointed to a new branch, the part studio had a new feature inside it and the screen showed a cube. I double clicked the feature, changed the height dimension and it got taller in the Z direction, that was good enough for me. Success!
I'm not that interested in creating features with AI. I just wanted to get it working. There are many other things I want AI to do but I need to get better at controlling it. Maybe we can figure that out, how to control AI.
0 -
So for example - and leaning into what @EvanReese said about bringing your opinion to the table for working with AI - there are a number of features out there that do repetitive geometry that generate with some kind of spacing pattern both in the standard library and in people's custom features. Many of these features do the exact same job using completely different mechanisms, or naming conventions, or input methods that apply in one specific narrow case and not the superset of cases. I've interacted with other people's versions of this spacing logic that I've felt were really clean implementations and versions that I've felt were really opaque or were too narrowly scoped to get the job done outside of the narrow context for which they were written.
I love the Laser Joint custom feature for being a simple to use utility to drop finger joint geometry onto a bunch of parts made from solids, but I hate how the spacing inputs work in it. They've also been hard coded to only work on only planar faces with straight edges, and almost every part that slides through my office needs curve or nonplanar support or both, so to copy this part of that script would box me and my parts into a utilitarian corner. By contrast there's @GregBrown's Curve Pattern Best Fit feature which solves the same fundamental spacing problem but isn't locked to planar domains and he even baked in path parameterization so you can do things that span multiple edges. When I was reworking my OnlyTabs feature for the dozenth time I realized that I was also solving the same spacing problem in a half dozen other features and I was equally unsatisfied with many of those solutions, so I stole Greg's code and prompted some agents to functionalize the spacing utilities and precondition into a standalone file that reproduced the original Curve Pattern Best Fit feature exactly but allowed the import of only those functions and the clean UI elements I liked into other features and now I've got the same spacing logic spread across OnlyTabs, Bip Joints, a yet-to-be-released hole placement feature that works on nonplanar surfaces, and a few internal tools that nobody really cares about.
In another case, I've got a suite of surfacing and model deformation utilities cooking in the oven right now with a similarly overlapping scope of almost-the-same-problem but with slight variations in the job that each tool does. In all of those cases though I want the UI to behave consistently between those features and consistent with the standard library so when I began to lay out my spec document describing how we were going to allow the user to interact with control points to manipulate these surfaces (or lattice cage points doing the same thing) we would be using the Routing Curve std library feature as our template but extending the logic to work with 2 dimensional control point nets of U and V point manipulation (or 3 with UVN) to keep everything feeling Onshapey and normal. The final implementation requires a different storage method for the data because Routing Curve can treat things like a single dimensional array and I had to use the full triad manipulator with rotation for movement because I'm dragging things that I'd like to tilt along a shared plane sometimes, but I made none of those edits or improvements myself. I just had a conversation with Claude Fable about how much logic could be directly ripped and how much needed extended. Sometimes it got it wrong first and we made changes later.
Even with that core textbook Routing Curve example using the isButton button Claude needed to be slapped with a .md explaining that we did not in fact want a rotate handle UI element shoved into the precondition and that it needed to look closer at the canonical example and write a roadmap that it'll listen to next time I need some editing logic button magic. To this day, I still don't know how to write that logic myself but I don't really need to. I just need to know when it makes sense to use it and when I should pick something else.
1 -
@Derek_Van_Allen_BD I've often wished someone would encapsulate manipulators and making them more friendly to use. Possibly this would be a good use case for AI.
possible prompt:add some sanity to this and dump all the manipulator code inside a code box.
I would want a simple map declaration for a manipulator with a simple array to control many manipulators stuffed with simplified manipulator map definitions. You could define an hover event handler to return an index to the array to activate logic for the individual handles.
When you look at featurescript code 90% is just the manipulators.
I'm much to lazy to deal with that. That's why I don't have any manipulators in my feature scripts, but I do admire those that do.
0 -
I asked ChatGPT to package up the process that happened when I created the End Cap Plus feature. There are some missing things, but this might be a helpful record.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
One thing that I think is missing from that guide (but I did mention it in an earlier post) is that I use "/plan" mode a lot. Both Codex/ChatGPT and Claude have modes like this. It's super useful/essential because you prompt, it comes back with qualifying questions to guide the development and then it generates a plan document before actually creating any FeatureScript (or whatever it is that you're doing). The question and answer process really helps dial in what it is that you want it to do, and helps avoid it going off the rails.
I'm sure there are a zillion things out there about plan mode, but this video came up, and it seems pretty good, even if it's ancient (7 months old) in the AI development world.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
I've been working on some curve fairing ("Approximate Curve Plus") features. As part of this, there's a lot of math and algorithm development which is somewhat independent of FeatureScript and Onshape. Béziers and B-Splines are all built on the same math, no matter what the CAD kernel.
ChatGPT Astra decided on its own to start simulating things locally using python. This is an interesting development since it's quicker and requires no Onshape API tokens. It's using the learnings from its local work to then port that to FS and Onshape. I get a lot of reports, graphs and equations from and we then use those learnings to move forward.
Just some more food for thought.Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
1 -
-
@Derek_Van_Allen_BD that's impressive…..
Have you tried "shaded without edges"?
Have you tried "shininess"?
While you're in there you may want to change the line thickness to 1px. The edge boundary lines look like huge cables tying your cool surfaces together also giving away how it was built.
Have you bitched about "constrained occluded color"?
Probably not but we need that. I sent in a support ticket and they came back and told me I wasn't a professional, I have to list my bitches on the forum. If you're running a darkened background with dark parts, your can't see sketch entities when editing sketches. I'd like it to be gray but there's no option for changing it. This forces me to define a section view on the sketch before I edit the sketch. This way too much work.
I've been bitch'n about the graphics inside to OS for years and today, there really good. Recently, you can't edit a sketch entity that's buried inside the model because you can't see it, at least I can't.
I don't mind bitch'n on this forum, it's easier than filling out a support ticket.
0 -
Look at the image above and tell me what the sketch looks like. White is constrained but the occluded constrained color should not be black and I can't change it!
I've added the constraint manager because I've been using it a lot and it's really good. 2 thumbs up.
0 -
I've posted some early development clips on the community discord showing some of the surfaces without edges and with the zebra stripes or curvature analysis tools.
In some respects I want to show off the edges at this stage of development. I want y'all to know it's T spline architecture under the hood. I'll probably merge the bezier patches later on with some motorcycle graph magic when I get closer to launch for less edge clutter in the part studio.
Not a featurescript project though.
0 -
It'd be nice to have chrome inside OS, I'm not a chrome guy though. We stare at our screen all day, and in the past, at parts the colors of a rainbow, why can't they look real?
OS is doing a great job with it's graphics, but I'm still wondering why we have to have a rendering package?
0 -
And then there's the real stuff…
The cad model looks better than the real stuff.
1
Categories
- All Categories
- 10.2K Community Support
- 4.6K General
- 194 Account and subscriptions
- 353 Data management
- 1.6K Product Feedback
- 215 New in Onshape
- 14 Onshape Labs
- 75 CAM Studio
- 35 PCB Studio
- 107 Simulation
- 209 Onshape Mobile
- 315 App Store & Partners Apps
- 8.2K Using Onshape
- 1.8K Drawings
- 2.3K FeatureScript
- 324 Learning Center
- 253 Education Community










