Python create point(s)

Can someone point me to where I might find a link describing the missing part of my code to create multiple points not just the last in the sequence.

I am happy to read any reference, but would apreciate any help in finding a good link explaining this paticular process.

import clr
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

x = IN[0]
y = IN[1]
z = IN[2]

pt = []

for xpt,ypt,zpt in zip(x,y,z):
	pts = Point.ByCoordinates(xpt,ypt,zpt)

	
OUT = pts;

Thanks.

Your output in the code above is the last created variable called “pts”.
Instead you should use your list “pt”, created before the loop:

pt.append(Point.ByCoordinates(xpt,ypt,zpt))

and then:

OUT = pt

1 Like

import clr
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

x = IN[0]
y = IN[1]
z = IN[2]

pt = []

for xpt,ypt,zpt in zip(x,y,z):
	pt.append(Point.ByCoordinates(xpt,ypt,zpt))
	
OUT = pt;

It Worked!
@maciek.glowka thank you for sharing your time!

3 Likes