Maybe you are minding why I'm so unskilled in TikZ statements, the reason is time of learning. Yes, just faced the magic world of \foreach command only a dozen of days ago.
Please, look at next application carried out today [two more utilizations of \foreach, dimensioning columns and horizontal loads, recursive routine applied] and, if you wish, let me know how to obtain better refinements. Thanks a lot and cheers.
Code: Select all
% --------- tikz3.tex --------- Apr.29,2015 --------- Ended Apr.29 ---
%
\documentclass[10pt]{article}
\usepackage{tikz}
% ---
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{center}
\setlength\PreviewBorder{10pt}%
% ---
\tikzstyle{load} = [thick,-latex]
\tikzstyle{stress} = [-latex]
\tikzstyle{dim} = [latex-latex]
\tikzstyle{axis} = [-latex,blue!55]
% ---
\tikzstyle{two}=[x={(1cm,0cm)},y={(0cm,1cm)}] % axes scale, 1cm
\begin{document}
\begin{center}
% =================== Start Picture =================
\begin{tikzpicture} [two]
% ----- a) Macro for Axes Plot, blue dashed, elements and grid (same scale) ------
\begin{scope}[xshift=0cm, yshift=0cm, rotate=0, scale=0.4]
\coordinate (O) at (0,0);
\draw[axis,two,dashed] (O) -- ++(17,0) node[right] {$x$};
\draw[axis,two,dashed] (O) -- ++(0,31.5) node[above] {$y$};
% -------- b) Draw structural elements
\draw[thick] (0,0) -- ++(0,30); % 1st column [starting point to increment]
\draw[thick] (12,0) -- ++(0,30); % 3rd column
\draw[thick] (5,0) -- ++(0,6); % 2nd column (part a)
\draw[thick] (5,9) -- ++(0,15); % 2nd column (part b)
\draw[thick] (5,27) -- ++(0,3); % 2nd column (part c)
\draw[thick] (14,9) -- ++(0,12); % 4th column (ext.wall)
%
\draw[thick] (0,3) -- ++(12,0); % storey #1
\draw[thick] (0,6) -- ++(12,0); % storey #2
%
\draw[thick] (0,9) -- ++(14,0); % storey #3
\draw[thick] (0,12) -- ++(14,0); % storey #4
\draw[thick] (0,15) -- ++(14,0); % storey #5
\draw[thick] (0,18) -- ++(14,0); % storey #6
\draw[thick] (0,21) -- ++(14,0); % storey #7
%
\draw[thick] (0,24) -- ++(12,0); % storey #8
\draw[thick] (0,27) -- ++(12,0); % storey #9
\draw[thick] (0,30) -- ++(12,0); % storey #10
%
% -------- b2) Draw grid
\draw [step=1,blue,dotted] (0,0) grid (14,30);
% -------------------------------------------------
%
\end{scope}
% ---- Horizontal Loads applied to structure nodes
\begin{scope}[xshift=0cm, yshift=0cm, rotate=0, scale=0.4]
\foreach \z in {3,6,...,27} {%
\draw[load,blue] (-2,\z) -- ++(2,0) node[pos=0.4,above,xshift=0cm] {$0.50\,t$};}
% last load, upper storey
\draw[load,blue] (-2,30) -- ++(2,0) node[pos=0.4,above,xshift=0cm] {$0.25\,t$};
\end{scope}
%
% ---- Vertical Dimensioning --------
% x-axis rotation [dx=3]
\begin{scope}[xshift=6.40cm, yshift=0cm, rotate=90, scale=0.4]
\foreach \z in {0,3,...,27} {%
\draw[dim] (\z,0) -- ++(3.0,0) node[sloped,midway,below,rotate=90] {$3.0$}; % col. dimension
\draw (\z,-0.3) -- ++(0,0.6);
}
\draw (30,-0.3) -- ++(0,0.6); % upper tick
\end{scope}
% ---- Horizontal Dimensioning --------
\begin{scope}[xshift=0cm, yshift=0cm, rotate=0, scale=0.4]
%1st span
\draw[dim] (0,-1) -- ++(5.0,0) node[sloped,midway,below] {$5.0$};
\draw (0,-1.3) -- ++(0,0.6);
\draw (5,-1.3) -- ++(0,0.6);
%2nd span
\draw[dim] (5,-1) -- ++(7.0,0) node[sloped,midway,below] {$7.0$};
\draw (12,-1.3) -- ++(0,0.6);
%3sd span
\draw[dim] (12,-1) -- ++(2.0,0) node[sloped,midway,below] {$2.0$};
\draw (14,-1.3) -- ++(0,0.6);
\end{scope}
% ------ Soil anchors ---------------
% ------- Fixed End - #1
\begin{scope}[xshift=0cm, yshift=0cm, rotate=0, scale=0.4]
% bar
\draw[thick] (-0.7,0) -- (0.7,0);
% Ticks
\draw (-0.4,-0.4) -- (0,0);
\draw (-0.7,-0.4) -- (-0.3,0);
\draw (-0.1,-0.4) -- (0.3,0);
\draw (0.7,-0.4) -- (0.3,0);
%
\draw (0.4,-0.4) -- (0,0);
\draw (0,-0.4) -- (-0.4,0);
\end{scope}
% ------- Fixed End - #3
\begin{scope}[xshift=4.8cm, yshift=0cm, rotate=0, scale=0.4]%4.8cm, due to scale factor 0.4
% bar
\draw[thick] (-0.7,0) -- (0.7,0);
% Ticks
\draw (-0.4,-0.4) -- (0,0);
\draw (-0.7,-0.4) -- (-0.3,0);
\draw (-0.1,-0.4) -- (0.3,0);
\draw (0.7,-0.4) -- (0.3,0);
%
\draw (0.4,-0.4) -- (0,0);
\draw (0,-0.4) -- (-0.4,0);
\end{scope}
%
% ------- Fixed End - #2
\begin{scope}[xshift=2cm, yshift=0cm, rotate=0, scale=0.4] %2cm, due to scale factor 0.4
% bar
\draw[thick] (-0.7,0) -- (0.7,0);
% Ticks
\draw (-0.4,-0.4) -- (0,0);
\draw (-0.7,-0.4) -- (-0.3,0);
\draw (-0.1,-0.4) -- (0.3,0);
\draw (0.7,-0.4) -- (0.3,0);
%
\draw (0.4,-0.4) -- (0,0);
\draw (0,-0.4) -- (-0.4,0);
\end{scope}
%
\end{tikzpicture} %
% ========================= End Picture =================
% ----------------------------------------------------------
\end{center}
\end{document}
% ---- EOF: tikz3.tex ----