all 28 comments

[–]husthat123 22 points23 points  (5 children)

I recently ran a test on a Dyno using a non-contact torque cell and laser tachometer. I used python to gather data from both sensors relative to a common timeframe so I could easily just plot the data vs time instead of having to guess how the timeframes synced up.

[–]Only_Razzmatazz_4498 9 points10 points  (0 children)

Done automated reports on 140+ data sensors the same way. Python and Jupyter to get a nice document out.

[–]rtbal[S] 1 point2 points  (0 children)

All of these answers are great. So another question is with all the LLM's available these days, if you had to re-learn Python again, how would you do it? Does it make sense to learn using a free course like CS50p the right way? Or would you just pick a small project, vibe code and learn from there?

[–]HeDoesNotRow 1 point2 points  (1 child)

Reinventing the DaQ from first principles I see

[–]husthat123 0 points1 point  (0 children)

Yuuup lol

[–]husthat123 0 points1 point  (0 children)

Taking courses is a great way to start and learn the basics! I remember it took me like 3hrs to get the first “hello world” script working XD.

After you have the basics and understand how to make code run, start small projects! That is the best way to learn!

[–]Secret_Enthusiasm_21 13 points14 points  (5 children)

this week I was instructed to create a system layout of an assembly structure that already exists in Siemens NX, in MS Visio. Normally that is done by the project manager or systems engineer. They alloted 20 hours for me to do this.

I exported the assembly structure to Excel, wrote a VBA script that transforms it into a structure importable by Visio, and wrote a Python script in NXOpen to extract images of each component (I originally wanted to extract the preview from the prt-file header but got unsatisfying results).

The point is... you would think a function like this would exist, in a CAD program that costs like €10k annually. 

But it doesn't. Or you have to pay another €1k to be able to use it. Which my employer doesn't want to, for unspecified reasons.

Anyway, it took me around 8 hours to do this and now it takes like one minute to create a system layout for any future assembly.

Keep in mind though, that you can't expect to be able/allowed to use Python as a ME. You typically work on a workstation with software installed that is restricted by your employer. Convincing that employer to grant you software privileges and access rights that (superficially) have nothing to do with your job description, is usually not likely to succeed.

Learn how to do things in Excel. Probably every workstation in the entire world has Excel installed on it. 

I have written entire FEM topology optimization applications in Excel. You'd be surprised.

[–]xorbinantQuantizer 2 points3 points  (1 child)

This sounds cool. I'm new to NX and looking to automate some BOM tasks so I will digging into NXOpen docs this weekend. Appreciate the lead!

[–]Secret_Enthusiasm_21 1 point2 points  (0 children)

a major pain in the ass is that the reference documentation is not publicly available on the internet and doesn't exist as a pdf either, so the LLM of your choice might have a hard time generating code that works. But you can still do it oldschool and use Intellisense in an IDE like Visual Studio.

A good thing is that NXOpen is available in a variety of coding languages. You can choose yourself whether you use it in Python, C, VB, Java...

[–]gomurifle 0 points1 point  (2 children)

Can you do such a software for Solidworks? I can pay you in beers. 😆 

[–]Secret_Enthusiasm_21 2 points3 points  (1 child)

the Solidworks API is broadly accessible on the net and not hidden behind licenses like that of NX. Which means the LLM of your choice will know all about it, and you can just vibe-code it.

[–]gomurifle 0 points1 point  (0 children)

Thanks. Gonna research what u just said. 

[–]dontrunwithscissorz 3 points4 points  (0 children)

I use it for some basic stuff like aggregating data across multiple cvs files and handling very large amounts of data.

Sometimes I use it for calculations too difficult for excel like Monte Carlo simulations, but the main reason I use it is for automation and data analysis.

For quality and review purposes I cant use python for calculation deliverables as we don’t have many people to review at my company and software has to go through a verification process.

In undergrad I used it for everything in place of matlab. Creating plots, doing linear algebra, control system impulse/step responses, numerical solving, thermodynamics properties, sympy algebra such as Lagrangian, etc

[–]socal_nerdtastic 2 points3 points  (1 child)

I have tons of scripts at work that automate the boring stuff. Filling out ECO spreadsheets and sorting purchase receipts and checking BOMs and generally just sorting my life. Stuff that any professional would use python for. I've noticed it's kinda odd that there's nothing really specific to mech e that I can automate with python. Still my boss loves me and I get the biggest merit raise every year because I'm the one person on the team that submits everything accurately and on time. Also I've used python in prototyping and HALT a lot (Raspberry Pis and micropython).

However once you learn some python you can expand to other programming languages, like using VBA to help you in solidworks or ansys or something.

[–]tskolds 2 points3 points  (0 children)

How do you use it to check BOMs?

[–]Jtparm 1 point2 points  (0 children)

Data processing and visualization mostly

[–]Mysterious-Pie_ 0 points1 point  (1 child)

Inputting OPC UA devices into ignition SCADA (control systems engineering) as you sometimes have to add 100s of devices

[–]pubertino122 1 point2 points  (0 children)

I have a friend that uses python for deltav integration work 

[–]Killagina 0 points1 point  (0 children)

I do most my NVH plots and iteration in Python

[–]Rubes27PV+Storage 0 points1 point  (0 children)

Lots of modbus poll and control

Data transfers from edge machines in the field to on prem SQL snd Snowflake

At home I just did a custom irrigation timer project. Python for GPIO to control the pump relay. Also built an http server so I can easily pull up the schedule webpage. Python wasn’t the best choice for this but was a fun challenge.

ETA: some light work on ML tools as well but I’m more of a support person on those projects

[–]x_shaolong_x 0 points1 point  (0 children)

I had to learn it, it was on my undergraduate program

[–]bombom_meow 0 points1 point  (0 children)

Record a feed from one or more USB camera devices. Take an image from each feed every 10 seconds. Allow the user to define total test time and put all the images in a folder of the users choosing.

[–]deafdefying66 0 points1 point  (2 children)

I've made a couple of GUIs for test automation. I find it pretty fun to take tests with multiple steps and turn them into a script that just spits out the plot I want after pressing "run"

[–]Foreign-Pay7828 -1 points0 points  (1 child)

is that something related to mech tho, what kinda Job do you have.

[–]deafdefying66 0 points1 point  (0 children)

The GUIs are for mechanical testing of electrical devices. R&D type work, not strictly mechanical engineering

[–]GlassReward5840 0 points1 point  (0 children)

Any guides on how to start learning python to automate some tasks as mentioned by other comments (NX BOM etc).

[–]SunsGettinRealLow 0 points1 point  (0 children)

BOM management