This is going to be a little tldr; but I have some strong opinions about this.
The correct guidance depends on what you want to get out of learning to program. If you want to have the bare minimum of understanding for practical programming as an engineer, then you could probably learn a little C++, maybe some Fortran and Matlab, and leave it at that. However, this would be a great disservice to you!
If you want a real understanding of programming from a deep perspective, I would recommend you learn 1 language from each of these categories:
Procedural (eg: Fortran)
Object Oriented (eg: Java/C++/Python)
Functional (eg: Scheme/Lisp)
Declarative: (eg: Prolog/Regular expressions)
Math/Array-based: (eg: Matlab)
Assembly (Choose some embedded cpu in an interesting application and learn how to program it)
Java is a good place to start because it is pretty newbie-friendly and you can make little games and such without as much hassle. Python might also be a good place to start.
In each of these cases, try to use the language's strengths to solve your programming problems - use array operations instead of loops in Matlab, use recursion rather than looping in Scheme, use object-oriented structures in C++, and so forth. This is basically what the first few CS-for-CS-majors classes will do at top universities. Now This is a big task, but if you do it then you will have a great depth and understanding of programming in general. Even though you may never use a functional programming language again, just knowing it will make you a better programmer in whatever other language you use. You will be able to pick up the fundamentals of any other language in a weekend or so.
Ok just a note because you mentioned it: Solidworks is not a programming language, it is a CAD program. You use it to draft 3D models of mechanical parts and assemblies, similar to how you would build a model in 3d animation programs (Maya, Max, Lightwave, Silo, Blender, Rhino, etc), except it is aimed at engineering applications. The main difference is that models are precisely specified parametrically, and in return there is less low-level mesh control. It's all point-and-click, there is no programming involved.
If, by the initial post, you want to learn a CAD program, Solidworks is a great starting point. I would recommend not doing AutoCAD. A lot of people just use AutoCAD because it has big name-recognition, but it is a fundamentally 2D program. They started with 2D many decades ago and tacked on 3D aspects as computers became powerful enough to handle it. If you start with AutoCAD you will develop a lot of bad habits. SolidEdge and Inventor are pretty good alternatives to SolidWorks. Modern parametric modeling programs are all very similar so if you know 1 you know them all.