One can definitelyalso make the pattern transformation part of the definition of the nodes. Please let me know if this is
\documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{patterns.meta} \pgfdeclarepattern{ name=MovableLines, parameters={ \pgfkeysvalueof{/pgf/pattern keys/distance}, \pgfkeysvalueof{/pgf/pattern keys/angle}, \pgfkeysvalueof{/pgf/pattern keys/xshift}, \pgfkeysvalueof{/pgf/pattern keys/yshift}, \pgfkeysvalueof{/pgf/pattern keys/line width}, }, bottom left={% \pgfpoint {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, top right={% \pgfpoint {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, tile size={% \pgfpoint {\pgfkeysvalueof{/pgf/pattern keys/distance}}% {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, tile transformation={% \pgftransformshift{% \pgfpoint {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}% \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}}, defaults={ distance/.initial=3pt, angle/.initial=0, xshift/.initial=0pt, yshift/.initial=0pt, line width/.initial=\the\pgflinewidth, }, code={% \pgfsetlinewidth{\pgfkeysvalueof{/pgf/pattern keys/line width}}% \pgfpathmoveto{\pgfpoint{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% \pgfpathlineto{\pgfpoint{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% \pgfusepath{stroke}% }, } \begin{document} \begin{tikzpicture}[here/.code={\pgfgetlastxy{\myx}{\myy}}] \path (0,0); \foreach \n in {0,...,5} { \node [rectangle,draw,minimum size=1cm,here, pattern={MovableLines[xshift={\myx},yshift={\myy},angle=-45,distance={sqrt(0.5)*3pt}, line width=0.4pt]}] at (1.1*\n cm, 0) {}; \node [rectangle,draw,minimum size=1cm,here, pattern={Dots[xshift={\myx},yshift={\myy}]}] at (1.1*\n cm, 1.1) {}; } \end{tikzpicture} \end{document}

(For some reason \pgfgetlastxy seems to be spelled outwork for all but the very first node of the tikzpicture. This is the reason for \path (0,0); here.)