C# - every "nth" item, out in a new Lis

How can a take every “nth” (which is a Parametric value form a number slider) to put into a list, this is not woriking. I have defined the number slider value as "double numberOfNodesLine "

When you add a double to an integer, you get a double. Your loop is defined for integers. You’ll have to change your numberOfNodesLine variable to type int for this to work.