Creatting points with Python Script

I trying do create this points with Python Script, but when i Run the script get this error mensage:

Rotina de pontos - Error Messange


Python Script

#Load the Python Standard and DesignScript Libraries
*import sys*
*import clr*
*import System*
*clr.AddReference('ProtoGeometry')*
*from Autodesk.DesignScript.Geometry import **

#The inputs to this node will be stored as a list in the IN variables.

*xi = IN[0]*
*yi = IN[1]*
*zi = IN[2]*
*xf = IN[3]*
*ex = IN[4]*
*count = xf/ex*
*list = [Point.ByCoordinates(xi,yi,zi)]*

#Place your code below this line

*while count > 0:*
*IN[0] += ex*
*list.append(Point.ByCoordinates(IN[0],yi,zi))*
*count -= 1*

#Assign your output to the OUT variable.
*OUT = list*

What i wanna do is create lines to be used for a Grid. I want the user to inform the start element, the X and Y size of the Grid and spacing of each point in X and Y. To do this i think about getting the center point os the element and creating points to create line and then creating Grid with this lines.

@rinacimareller

# Enable Python support and load DesignScript library
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
xi = IN[0][0]
yi = IN[1][0]
zi = IN[2][0]
xf = IN[3]
ex = IN[4]
count = xf/ex
list = [Point.ByCoordinates(xi,yi,zi)]
temp = 0
#Place your code below this line

while count > 0:
	xi += ex
	list.append(Point.ByCoordinates(xi,yi,zi))
	count -= 1

#Assign your output to the OUT variable.
OUT = list
1 Like

Thanks man. Helped a lot :+1:t3: :+1:t3:

1 Like