r/MechanicalEngineering • u/Wilthywonka • 12h 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
34
Upvotes
32
u/rhythm-weaver 12h 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.
2
u/EndingPop 6h 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.
5
u/Pinkys_Revenge 8h ago edited 8h 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.
4
u/ArbaAndDakarba 11h 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/lazydictionary Materials Science | Manufacturing | Mod 4h 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/Accro15 11h 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.
2
u/SimultaneousThought 12h ago
Yep, and quick custom apps too
1
u/SystemicAM 12h 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.
1
u/wimax91 12h 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)
1
u/PrestigiousDog9842 3h ago
Same here, custom properties and drawing updates are my favorite to automate
1
u/metarinka 3h 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 2h 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/PigSlam 12h ago
Yeah
1
u/Aggressive_Ad_507 11h 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.
1
u/joap25 9h ago
Made an add-in to connect inventor to our ERP tool. Amazing
1
u/TheBlack_Swordsman 7h 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/PigSlam 5h 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/Lunastarfire 11h 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.
0
u/BenchPressingIssues 12h 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.
0
u/thirty2skadoo 7h 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.
0
u/MyDogNamedRed 5h 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/buginmybeer24 7h ago
I've been doing it long before AI. The AI just makes it faster.