In a quest of an easy way to draw structural analysis figures for my question paper, I came across this rich library StAnLi few years ago. Being highly motivated from that library, I finally decided to develop a structural analysis library of my own. You can draw beam, frame, truss, cable or arch using this library.
I have used TikZ for drawing and Lua as my primary scripting language, so you need LuaLaTeX to run this library. You can download it from here, it also includes a sample (.tex) file.
You only need these few lines of codes to draw this beam.
\begin{luacode}
scale = 0.30;
----------------------------------------------------
O = origin();
A = node(O, 0, 0, "A");
B = node(A, 12, 0, "B");
C = node(B, 10, 0, "C");
E = { {A, B}, {B, C} };
----------------------------------------------------
P = pointLoad(A, B, 3, "g", "8", "P");
W = distLoad(B, C, "gd", "2", "");
L = {P, W};
----------------------------------------------------
Sa = support(A, "h");
Sb = support(B, "r");
Sc = support(C, "r");
S = {Sa, Sb, Sc};
----------------------------------------------------
HD = {A, P, B, C};
----------------------------------------------------
Iab = node(A, 5, 0, "(I)");
Ibc = node(B, 4, 0, "(2I)");
Pt = {Iab, Ibc};
----------------------------------------------------
drawFrame(E, L, S, HD, {}, {}, Pt);
----------------------------------------------------
\end{luacode}