I've only had to make a safety fence like shown in your image once.
I did it old school though, before I knew what patterns were, if I recall correctly. I created planes for the outer boundary, made 1 line in X and 1 in Y where I wanted them, then trimmed them.
Then use Tube to create the...