 # Curves through points from a point matrix

Hi all,

I’m very new to Python in Rhino and have run into a bit of a snag for a script I’m trying to write. In the lines below, I establish a point matrix based on user input via rs.GetInteger, save those to a list (ptList_1) and then try to create a series of individual curves from rows of x or y points so that I can loft a surface from them. The way it is written now, I can get a curve extending through the entire list, but am not sure how to stop it at each new line so that they’re individual. Sorry if this is poorly explained, but any help would be greatly appreciated!

``````import rhinoscriptsyntax as rs
import random

# Empty lists
ptList_1 = []

ptList_2 = []
# For curves to loft surface
crvList_1 = []
# For first set of circles
crvList_2 = []
# For second set of circles
crvList_3 = []
# Point dictionary for first matrix set
ptDict_1 = {}
# Point dictionary for second matrix set (moved points)
ptDict_2 = {}

# i, j and k values

imax = rs.GetInteger('Choose an x value', 10)
jmax = rs.GetInteger('Choose a y value', 10)
kmax = rs.GetInteger('Choose a z value', 2)

# Values for first point matrix loop

for i in range(imax):
for j in range(jmax):

x = i * 5
y = j * 5

point = (x,y,0)
# Save points to dictionary for line construction
ptDict_1[(i,j)] = point

#print ptList_1

for i in range(imax*jmax):
distance = rs.Distance(ptList_1[i], attPt_1)
move_1 = distance/2
#print move_1
ptList_2.append(rs.MoveObject(ptList_1[i], (0,0,move_1)))

for j in range(jmax):

Welcome @jcraig0611,

Are you looking for something akin to this?

``````import rhinoscriptsyntax as rs
import random

crv_list = [] # stores the curves to loft

imax = rs.GetInteger('Choose an x value', 10)
jmax = rs.GetInteger('Choose a y value', 10)
kmax = rs.GetInteger('Choose a z value', 2)

for i in xrange(imax):

crv_pts = [] # stores all points in x-direction

for j in xrange(jmax):
pt = [i*5.0, j*5.0, 0.0]
dist = rs.Distance(pt, att_pt)
pt = dist * 0.5 # change z-value
crv_pts.append(pt)