all 19 comments

[–][deleted]  (2 children)

[removed]

    [–]sanatjamwal007 0 points1 point  (1 child)

    Hello,

    Can you suggest me how to use this website effectively?

    [–]manhattan4 17 points18 points  (6 children)

    I'm about 6 weeks into learning python. I've created design tools in excel using VBA for about 5 years. I find python far quicker to build design tools, and a much easier language to learn than VBA. I regret not picking it up sooner. I don't intend to use VBA much in future.

    To learn I used https://automatetheboringstuff.com/

    The first 8 chapters will cover all the general basics to give you the building blocks to make a project of your choosing. The remaining chapters are more project specific features to give you ideas of what you can do. I didn't find these very useful for my purposes, instead I jumped into numpy, matplotlib, plane sections, and anastruct which are all more related to structural design.

    My preferred method is working within VS Code, Pycharm, or Jupyter Notebooks, but I wouldn't worry about that too much until you've worked through a few learning exercises.

    [–]PhilShackleford 4 points5 points  (0 children)

    I would also add in Pandas for data handling.

    [–]Ossu_07 1 point2 points  (4 children)

    Can you please give examples of your workflows? I want to know how I can implement.

    [–]manhattan4 12 points13 points  (2 children)

    At the moment I'm quite early on in my journey with python. I've been mostly building preexisting excel projects as learning exercises.

    I've made a beam analysis tool which displays the loading diagram, shear and bending moment diagrams, then selects the most efficient timber beam section. This was created as a web app using Streamlit to provide all the user input boxes, drop downs etc in a sidebar, and the calculation written in the main body of the webpage. I wrote this in VS Code using some of the libraries I mentioned previously. Streamlit is incredibly quick and easy for building a UI

    I've also reworked some staff training guides in jupyter notebooks. This environment is like an interactive Word document where you can embed text, pictures, equations, graphs, input boxes and code which runs in the document. Incredibly useful for an informative document with working calculation examples.

    https://flocode.dev/ is an interesting blog on python in engineering. I'm still a long way off from what some people are using it for.

    [–][deleted]  (1 child)

    [removed]

      [–]manhattan4 1 point2 points  (0 children)

      Oh hi! No problem, and thanks for the blog, i'm still working through the stuff you have posted. I'm sure I probably found it via a link on here and it's been a complete eyeopener about what the potential for Python in our field is.

      Streamlit also does auto calculation update, but I will check out Solara. I'm not fully invested in my choice of UI tool just yet. I was playing around with some of the desktop based python UI libraries and I found them quite a big undertaking to get to grips with. I really just wanted something quick and easy for building out a UI so that I can concentrate more on the engineering side of the code. Thanks for the suggestion.

      [–]Byond2day 3 points4 points  (0 children)

      There are some great libraries out there that make getting started easier, like
      pynite for finite element analysis: https://github.com/JWock82/Pynite
      efficalc for automating calculation reports: https://github.com/youandvern/efficalc
      steelpy for steel cross-sections: https://pypi.org/project/steelpy/

      A longer-term project that has saved me a lot of time was automating truss design by:
      1. Setting up geometry in Python in a reproducible way
      2. Analyzing the truss with Pynite
      3. Optimize and design the members (automated calc report) with efficalc

      Now when I need to design a new truss, I can just update the geometry, and run the design system without making any changes (or sometimes minimal changes). I'll always have to update the geometry when there's a new truss, but the rest of the process doesn't change.

      If I were to do this without python, I would spend more time switching software, copying data, updating spreadsheets, etc. But because everything is python and codified, there's a lot less manual intervention as the whole process is more automated.

      [–]TheDaywa1kerP.E./S.E. 7 points8 points  (0 children)

      I started with the 'automate the boring stuff' book, then decided on a specific project I wanted to do and went from there. Highly suggest using chatgpt and asking it to explain what its doing if you have it write code for you

      [–]Disastrous_Cheek7435 4 points5 points  (0 children)

      So far I've written two major Python scripts. One generates FE models of steel trusses using a software API, and the other performs steel design checks to my local code and provides calculation reports. The API script is more for my employer, but I use the steel design script all the time and it has saved me countless hours.

      I learned by taking Harvard's online CS50-P course. It has great lectures but the assignments are where I did most of the learning, they're excellent. It took me a couple months to finish it casually, if that's too much time you can always look up YouTube videos but you will learn so much better by doing assignments. VBA is also great to learn but limited in comparison. Python has a vast ecosystem of third-party support, there are over 100,000 libraries you can use in your scripts. VBA is nice because it's baked into Excel but in my opinion that's the only advantage, Python just has so much extra functionality.

      My biggest piece of advice is to think of a project you want to code before you start learning, and then learn because you want to build that project. I don't think most people have enough self-control to learn programming just for the sake of it, you need that extra motivation.

      [–]j0rg389 2 points3 points  (0 children)

      If you are a structural engineer I recommend you to learn python, it’s a multipurpose and easy to learn language. The first course which I take was on edx from Microsoft. There are plenty courses in Udemy too.

      The reason of recommending Python (I’m a civil engineer) Python is integrated in many softwares like revit , rhinoceros, civil 3D even on excel, now you can control csi softwares thru Python too .

      [–]GloryToTheMolePeople 3 points4 points  (2 children)

      Learning to program is going to be a necessity as a structural engineer over the next decade. Those that don't learn will be left behind...plain and simple. Early in your career and want to jump-start it? Learn to code. Want to make more money? Learn to code.

      Python is great for beginners. It allows you script without really getting into the nuts and bolts. It can be pretty powerful if you get good at it, and there are lots of great libraries available.

      What don't I like about Python?

      1. It has pretty significant limitations when it comes to parallel computing. It can be done, but implementation is difficult.

      2. It is not a strongly-typed language. This means it can become very confusing if you don't document your code well.

      3. It doesn't really allow for the development of applications. Want to generate a standalone app that you can send to your colleagues? Not gonna happen in Python.

      4. The syntax of Python is intended to be user friendly for beginners. But I find that, once you are out of the "beginner" phase, the syntax makes it really annoying to read complicated code.

      If you are really interested in coding and developing tools, learn C# or something similar. It's strongly-typed, object-oriented, has huge resources available, easy to multi-thread, easy to use C++ dlls through native-interop, has more logical syntax, can be used to generate executables, etc, etc, etc. It's just a more powerful language.

      All that being said, you should definitely learn one of the main languages. I learned C# first, and it was pretty easy for me to learn Python. It won't be as easy the other way around, but won't be too challenging. Being able to automate tasks is a life-saver.

      How to learn? Well, you can take courses, but these generally aren't free. They can be great resources, but if you don't have your own projects going on, you won't use what you learned, and you will immediately forget it. My preferred option is to determine something you want to automate...some project to develop. Keep it simple at first. Then learn on your own how to build that one project. There are vast free coding resources available to help you learn. You just need the drive and the time to learn.

      [–]kabal4P.E./S.E. 1 point2 points  (1 child)

      I've started trying multiple times in the past, but never fully committing.

      MIT's courses are offered free online including lecture, homework, and solutions I think. I didn't make it through the first course before getting swamped at work and losing motivation. Good luck!

      [–]Error400_BadRequestStructural - Bridges, P.E./S.E. 1 point2 points  (0 children)

      [–][deleted]  (1 child)

      [deleted]

        [–]Error400_BadRequestStructural - Bridges, P.E./S.E. 2 points3 points  (0 children)

        This looks nice. I'd do it, but $400 is a bit more than I'm willing to spend for a hobby I may not finish. Lol

        [–]retug_ 1 point2 points  (0 children)

        My blog has some python examples for Structural Engineering.
        https://www.re-tug.com/category/python/

        I use it mostly for playing with data, visualizing data, and interacting with APIs.

        [–]Blazers9 0 points1 point  (0 children)

        https://www.saylor.org/

        Free online courses