Point from (X & Y FROM a circle & Mtext content)

The solution is from this link
With a little modification

closest-point-from-long-list-to-a-point-in-a-shorter-list

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

# Inputs
short_list = IN[0]
long_list = IN[1]

# Output list
result = []

# Loop check for each point in the short list
for s in short_list:	
	# List for distances
	dist = []
	for l in long_list:
		# Distance to point s
		d = Geometry.DistanceTo(s,l)
		dist.append(d)
	# Lowest distance in list		
	min_d = min(dist)
	# Index of lowest distance in list
	min_ind = dist.index(min_d)
	# Get the closest point from the long_list
	closest_p = long_list[min_ind]
	# Add the point to the results, as it is the closest to the point from the short list
	result.append(closest_p)

# Output the results
OUT = result
1 Like