Even spread of Brick Pattern

Hi

I am new to Dynamo and am attempting to create my first script. I have tried and tried to get it to work but keep getting the message “Warning: The value used in a range expression must be a number or a letter.”
I have created a brick pattern hosted to the wall and would like to create a script to spread the pattern at a set distance across the building. The building contains a series of straight and curved walls. The pattern needs to be applied at a set distance over both and cut around any openings.
I have attached photo of my script but am unable to attach the model. I would appreciate it if anyone can explain what I have done wrong and how to fix it.

Thank you

Take a look at your screenshot, if the names of the nodes are not readable it becomes a lot harder for people to help you…

You are passing the letter “l” into a range expression, get rid of the small codeblock between your GetParameter and the range codeblock to see if that makes a difference. If not, take a look at the previews of the nodes to see if you get any unexpected results.

or maybe “Length” with uppercase “L”. You get nulls from parameter.

Thank you Bjorn and Deniz for your input. I have tried a combination of both but still can nor get the pattern to adjust around the curved walls.

this is the model before running the script

and this is the model after running the script

The family is wall hosted but doesn’t seem to follow neatly around the face of the wall. any ideas why?
Thanks in advance for your advice.