r/MechanicalEngineering • u/Wilthywonka • 3d ago
Using AI to create macros/scripts is powerful
Anyone else been using AI to create macros/scripts to automate your repetitive work?
We all know that macro/script recording and playback for programs such as solidworks and SAP can be used to automate tasks. Over the past few months I've found that vibe-coding custom macros is very effective. Wanted to see what other engineers are doing with this
51
Upvotes
45
u/rhythm-weaver 3d ago
Yes. We’re forced to use Copilot and I don’t trust it to handle the big picture. I use it to build the blocks that I assemble into the big picture.
7
u/EndingPop 3d ago
I'm replacing some of our expensive software with free stuff Opus can make. If you're careful in how you scope/define the work and test it thoroughly it does a great job. I point it at "/grill-me" from Matt Pocock's skills (https://github.com/mattpocock/skills) and have it work through the issues with me.
15
u/Pinkys_Revenge 3d ago edited 3d ago
I’ve found it’s very good at checking spreadsheets for errors (we have budgets that are huge spreadsheets and no one has the attention span to check them thuroughly, but Ai does a great job and often finds mistakes.
It’s also great at comparing docs to each-other. For example, we often have a pdf writeup about a project that can be 20+ pages long and an associated budget, Ai is great at spotting inconsistencies between the two.
It’s also great at writing the BS flowery language for emails you sometimes need for sales people or executives who don’t like the way engineers normally communicate.
6
u/ArbaAndDakarba 3d ago
Sure, but I've found much more value in building analytical calculators based on codes / standards. Claude is extremely adept at it.
2
u/wimax91 3d ago
Yeah I’ve used it to set my parameters for my parametric designs that have 200+ variables (like it pulls dimensions from online data sheets for components and changes the parameters to allow for mounting)
3
u/Accro15 3d ago
Use the AI to teach you about scripts until you're comfortable. Then use the AI to make scripts. Then you can review them with some confidence.
3
u/SystemicAM 3d ago
I did until I grew tired of AI bs and the ethical problems surrounding it, now I'm sworn off it. Happy to make scripts myself as I used to. If I'm not doing the work myself then I'd rather find other work to do.
2
u/Aggressive_Ad_507 3d ago
I vibe code excel. It's great to get widgets and light databases set up.
My biggest uses have been reviewing documents for ISO and pressure vessel authority compliance.
2
u/joap25 3d ago
Made an add-in to connect inventor to our ERP tool. Amazing
2
u/lazydictionary Materials Science | Manufacturing | Mod 3d ago
We used to use Access for the front end of some of our internal databases. Been using LLMs to spin up web apps which are faster and more versatile now instead.
2
u/buginmybeer24 3d ago
I've been doing it long before AI. The AI just makes it faster.
1
u/Probably-Stable 2d ago
Good success feeding Claude code 2d drawings and allowing it to drive inventor to create 3d models. Also its interfacing with Vault to quickly pull reference models etc. very impressive
1
u/Usual-Recognition-49 1d ago
Agree, and I'd go one step further: I don't fully trust my own read of the code either. So I check the result.
After a change I put the old PDF next to the new one and compare the dimensions. Every dimension that's gone or different needs a reason. On one part that went from 550 to 715 mm wide that meant going through 5 sheets. Boring, but it's the only way I'd sign it.
1
u/SimultaneousThought 3d ago
Yep, and quick custom apps too
1
u/PigSlam 3d ago
It's pretty powerful. I've been tinkering with some game development stuff on my own time, and I've essentially built a CAD vault database/data store with viewer for managing assets I've had AI agents build using Blender/Godot Game Engine. It's incredible what you can have with a little planning and guidance.
1
u/PigSlam 3d ago
Yeah
1
u/BenchPressingIssues 3d ago
Yeah. I had it create a VBA macro to plug data from a spreadsheet into word document templates and save copies with the proper name.
1
u/TheBlack_Swordsman 3d ago
Yes. For FEA stuff. It's been very helpful. LS-DYNA, automation of 100s of bodies to generate contact properties and then automating their force results out into Excel and then automating their force outputs in graphs, etc.
Turned 60-80 hours of work now into 8-12.
1
u/thirty2skadoo 3d ago
I’m automating all the design release bullshit workflows. The workflow has a UI that a human audits - the code under it is deterministic. I’be just setup Fluent MCP and I’m going to start using that for sim setup and post processing.
1
u/MyDogNamedRed 3d ago
We have inventor, I use chatgpt to build some Ilogic form tool that helps with repetitive modeling, drawing details routine, its pretty useful.
1
u/metarinka 3d ago
I'm going beyond that.
It finishes up data packages. Exports. Relinks files. Light pdm work, folder structuring and Rev control.
I also have lots of simple but repetitive parts. Like drill bits in different diameters. It will make a macro but also just kick out the entire package and run tests to verify
1
u/sergiogsr 3d ago
At first I tried to create new macros or VBA code with copilot... but quickly found out that you can create tools using html format. Its easier, more powerful and its all local and works without internet connection if needed.
You create a local html file that can take a file in different formats if needed and: Can process it based on the source file content. Can compare several different files. You can interact with the source file using forms, combo boxes, controls and check boxes. You can load databases so it uses them to process the source file.
And of course, can get an output file with the processing complete.
I have created several tools like this. It has helped me to create:
Average creation time for most of the tools is less than an hour with Copilot, but you need to have a structured process to define the flows and validation of the output.
-1
u/Lunastarfire 3d ago
Using AI to vibecode is fine for random low effort, low complexity tasks but its like trusting your uncle who only rides a push bike but has watched a load of youtube vids of pit crews and now youre getting him to fix an F1 Car.
He might be gods gifts to mechanics, but more likely it will be done with very low efficiency, major critical elements will be missed, and since you never checked in on it once, you just got to trust it doesnt explode.
Personally, I use it more like an apprentice, I ask it to do things that are broken down enough for it to understand, that I can quickly skim through to ensure its doing what I think its doing and to be open to new approaches, but ultimately its my work at the end.