The following programs are written in Visual Basic 6. Mostly they are useful for the code snippets, but there are some fully-fledged applications here also. The source codes are given, as are some of the installation programs. Note that the inclusion of the run time files bloats the download. The programs are released under the terms of the GNU General Public License.

FEBeam

This program is the most comprehensive I've written in Visual Basic. It is a finite-element analysis package for beams alone. Its benefits are that the second moment of area, as well as the modulus of elasticity can be varied throughout the beam, in steps or curves or even a mixture of the two. All regular forms of loading are allowed for as are fixed displacements and spring supports. An automatic meshing routine, as well as a user-defined mesh density also feature. This combination make it very useful for checking unusual design scenarios not covered by regular analysis software. There are some limitations to it though, for example the output is not comprehensive and neither is the error checking. But it is still a useful program, and a good introduction to programming the finite element method. There are an endless list of possible upgrades to this program, but at the moment I don't have any intention of doing more work on it. Note that Section 15 of the GNU GPL, Disclaimer of Warranty, and Section 16, Limitation of Liability, are particularly pertinent to this engineering design program. Source (305 KB) -- Installation (5.61 MB)

TrussMaster

This is a fairly functional truss analysis program that features common CAD commands. A user-defined grid can be set up and nodes snapped to grid points and members drawn between nodes. Loads and supports can be defined in the data entry grid, or by generation. Members and nodes can also be created using the node/member generation boxes. Member properties can be generated for any sequence of members, or input via the data entry grid. Note that a pinned support is input as a "1" and a roller support as a "2". The member and nodal results are output in a grid, whilst the deflected shape is drawn to a user-defined scale, and can also be animated to examine the structural behaviour. There are features required before the program is really useful, such as:
  • member forces to be drawn in window;
  • animation re-scale;
  • better support conditions definitions;
  • better output of results;
  • member selection and editing;
  • move node feature;
  • better drawings of loads and supports.
I'm not sure when I'll get around to these features (if ever!) so you get it as it is - it's still very useful though. Note that Section 15 of the GNU GPL, Disclaimer of Warranty, and Section 16, Limitation of Liability, are particularly pertinent to this engineering design program. Source (96 KB) -- Installation (4.33 MB)

TrussGenerator

For some standard trusses, it is laborious to type all joint/member coordinates and loadings into TrussMaster. Therefore this little program generates a TrussMaster file for standard truss configurations. (Actually I lie - it only does the Pratt or "N" configuration for now :)). Source (19 KB) -- Installation (2.73 MB)

EC5 Joist

This program is a useful design tool for checking domestic joist designs to Eurocode 5. All usual configurations of span, joist spacing, joist size and material grade are allowed for. Design checks include bending, shear, end-bearing and deflections. The material properties are held on a database file that must reside in the same directory as the exe file. Definitely useful as a fully installed program. Note that Section 15 of the GNU GPL, Disclaimer of Warranty, and Section 16, Limitation of Liability, are particularly pertinent to this engineering design program. Source (20 KB) -- Installation (6.21 MB)

Steel Sections Database

This is a simple program that renders the section properties and an image of a selected steel section from the included database. The sections included are UB, UC, UBP and PFC (though I think the PFC crashes it :)). It's a basic introduction to how one might include a sections-library into a larger program. Source and exe (43 KB)

Graph Displacement

This is a small program that graphs the Euler-Bernoulli shape function for a flexural member when the end translations and rotations are given. It then finds the location and value of the maximum displacement along the element. Sort-of useful in its own. It was included into FEBeam to visualize individual element displacements. Source and exe (43 KB)

Recently Used Files

This program demonstrates the use of a module that manages the recently used files list in the File menu. This version is an update of the previous one that has been downloaded over 36,000 times (here)! This program's main use is to provide the RUF module for inclusion in your own package. Therefore the installation program really only serves to provide the runtime files if needed. Source (15 KB) -- Installation (2.83 MB)

Linear Simultaneous Equations

This program demonstrates two modules written for the solution of matrix equations. The modules are for Gauss Elimination and Cholesky Decomposition. These modules are useful in larger programs, such as finite-element or stiffness method solutions. Both FEBeam and TrussMaster use the Gauss Elimination module as it is found to be more robust than the Cholesky Decomposition module, which (strangely) is the preferred solution method of commercial programs. Not tremendously useful as an installed program. Source (17 KB) -- Installation (2.61 MB)

Stochastic Beam Design

This program uses the Monte Carlo method to calculate the probability of failure of a simply-supported beam in which all variables are stochastic. Each variable can have one of the five different probability distributions which are allowed for. Possibly interesting as an installed program to investigate safety levels in a potential design. Source (23 KB) -- Installation (3.7 MB)

Operations Time

This program finds the time required by different operators (+, -, x, /) on your particular machine. Source and exe (43 KB)

31 comments on “Visual Basic

  • This is programs source codes are the best free engineering source codes I have seen. God bless you real good for giving this out. I am a civil /structural engineer and I lecturer in a university in Nigeria. I will appreciate having more of this free codes and books in visual basic/visual basic.net.Thank you sir.

  • Thank you for this great share. I used to be a visual basic programmer (vb5 and vb6, i know it’s old lol) and i can see the quality in your programs. Thank you so much for this great share. Jason

  • Just stumbled upon this great site while looking for programming material on Beam design. Thank you for sharing the VB Source Codes. Greatly appreciated.

  • Thank You Very much for this program but i want ask you how can we find a moment on specific distance in your Code you put moments only on Nodes

  • great works!! thanks for share the code which very usefull for my study.
    it will be so complete if i can get the code for 3D truss, sir (please).
    god bless us all.

  • Great resource for bridge engineers, Thanks.

    I recently launched a bridge assessment program, a free version is available at bridgeassessment.co.uk

  • Rob,
    Looks really slick – well done, and the best of luck with success for it. Did you write it in C#?
    Colin

  • Hi Colin thanks very much, Yea it’s written in C#, it’s a great language and combined with windows presentation foundation (WPF) you can get some great UI’s and sharp looking reports using the XPS document format.

    Kind Regards
    Rob

  • Hey there ! its really nice work i have also created some civil engg related softwares e.g. Trruss Analysis and beam solution for indeterminate beams. hit me on email

  • On the joist program- can anyone tell me the major equation differences from the Eurocode to the International Building Code or BOCA building Code? It seems like a useful program that i can use. I could take the force effects and then design independently.

  • i am studying production engineering in the university of Benin,Benin city NIGERIA.THANKS FOR THE WONDERFUL JOB AND ALLOWING PEOPLE TO HAVE ACCESS TO YOUR WORK.PLEASE,KEEP UP THE GOOD WORK.

  • Dear Dr Caprani, thanks for sharing the source code to your excellent programs. I downloaded the source for trussmaster, but there does not seem to be any project file. Could you guide me to set up the project for compilation?

  • Based on the GUI of the program, I think ETABS were programmed using Visual Basic.
    Anyone who agree with me?

  • Thanks for this great sacrifice. Can help with any step by step manual on VB6.0 as am new to it. I will kindly request source codes for solving upto 10 by 10 matrixes. thanks

  • Dr. Caprani, thank you so much for the very excellent FEBeam program. I have already written

    versions of this program to run both in Microsoft Excel and SMath Studio platforms. Both are

    functional and had been put to use for almost 3 years now.

    However, I found a slight problem on the program; a programming bug. The program returns incorrect

    results with TRAPEZOIDAL LOADING for both shear and moment diagrams. Of, course, this has also

    affected the results for the REACTIONS. I’ve already made several attempts to correct the results

    by modifying the program but with no success.

    Below is the subroutine where the error is generated:

    ‘———————–

    Sub Apply_TDL()
    Dim i As Long
    Dim q As Long
    Dim tDisanp As Long
    Dim tDisbnp As Long
    Dim Inc As Double
    Dim L2R As Boolean
    Dim L_Ele As Double
    Dim wL As Double
    Dim wR As Double ‘Leftload and rightload of element
    Dim w1 As Double
    Dim w2 As Double ‘Small large load values
    Dim Mmax As Double
    Dim Mmin As Double ‘Big m little m
    Dim Rmax As Double
    Dim Rmin As Double ‘Big R little R

    For i = 1 To tLn
    For q = 1 To mod_nNp
    If Abs(mod_X(q) – tDisa(i)) <= mod_PREC Then
    tDisanp = q
    End If
    If Abs(mod_X(q) – tDisb(i)) <= mod_PREC Then
    tDisbnp = q
    If tDisanp < tDisbnp And Not tDisanp = 0 Then q = mod_nNp
    End If
    Next

    If tLoadw1(i) <= tLoadw2(i) Then 'decides slope of tdl
    L2R = True 'left rising to right
    Else
    L2R = False 'r 2 l
    End If

    Inc = (tLoadw2(i) – tLoadw1(i)) / Abs(tDisbnp – tDisanp)

    For q = tDisanp To tDisbnp – 1
    L_Ele = mod_L(q) 'Length of Element

    wL = tLoadw1(i) + Inc * (mod_X(q) – tDisa(i))
    wR = wL + Inc * L_Ele

    If L2R Then 'Allocates w1 & w2
    w2 = wR
    w1 = wL
    Else
    w1 = wR
    w2 = wL
    End If

    Mmin = (3 * w1 + 2 * w2) * L_Ele ^ 2 / 60 'absolute values
    Mmax = (2 * w1 + 3 * w2) * L_Ele ^ 2 / 60 'for the applied
    Rmin = (19 * w1 + 9 * w2) * L_Ele / 60 'nodal actions
    Rmax = (11 * w1 + 21 * w2) * L_Ele / 60 'to be "signed"

    If L2R Then
    Call f_AppTof(Rmin, Mmin, Rmax, Mmax, q)
    Else
    Call f_AppTof(Rmax, Mmax, Rmin, Mmin, q)
    End If
    Next
    Next
    End Sub

    '———————–

  • Just to add to my previous comments (see above), the ERROR on trapezoidal loading can be easily detected by applying the same trapezoidal load — two times.
    ..
    1st time: Apply the SAME trapezoidal load with INCREASING intensity
    2nd time: Apply the SAME trapezoidal load with DECREASING intensity
    ..
    Then observe the resulting max SHEAR and max MOMENT on both conditions…
    The results, regardless of the intensity orientations, should be the SAME and EQUAL.

Leave a Reply

Your email address will not be published. Required fields are marked *