# attractor point

Glenn demonstrates a common way of manipulating geometry in a point list through something called an Attractor Point.

what’s in this video

In this video I demonstrate a common way of manipulating geometry using an attractor point. During the demonstration I introduce a function that we have not used before in the course—the rs.Distance function.

##### [Pause the video and take a moment to practice using attractor points]
Use the attractor point system in the Nested Loop: 2D Point Matrix code to manipulate the rotational angle of the transformed geometry.

#### tutorial code

#ATTRACTOR POINTimport rhinoscriptsyntax as rs#create an empty listptList = []#input a point to use as an attractorattrPt = rs.GetObject('select an attractor point',rs.filter.point)#incremental loop to generate pointsfor i in range(10): for j in range(10): #define x in terms of i #define y in terms of j x = i y = j z = 0  rs.AddPoint(x,y,z) #rs.AddTextDot((x,y,z), (x,y,z))   #save point values in a list ptList.append((x,y,z)) #loop through point list and print out index number and valuesfor i in range(len(ptList)):# print i, ':', ptList[i]# rs.AddTextDot(i, ptList[i])  ####CREATE TRANSFORMATION OF GEOMETRY#### #measure distance between attractor point and current point in the list distance = rs.Distance(ptList[i], attrPt) print distance/20 #create circle using distance value as radius rs.AddCircle(ptList[i], distance/20)