Hi @lando.schumpich and @piac,
Thanks for the hints. Previously, I read some of the online documentation and made sure the Type Hints were set properly for the inputs (Point 3D for points, and float for numeric inputs). However, when I change the Pts input to List Access, I receive this error message:
It seems Item Access is the way to go, so each point can be acted on independently as described by Giulio. I also experimented a bit with a component that tries to input a single point as the original script was intended, but came out with the same results.
PS. here’s the code that’s inside the GH component, in case it’s faster for ya’ll to just look at it here:
import rhinoscriptsyntax as rs
import math
edges = 6
levels = 3
hexGrid = []
work = 2 * math.sqrt((Hex_EL * Hex_EL) - ((Hex_EL / 2) * (Hex_EL / 2)))
def polygon(center,edges,size,angle):
tempCircle = rs.AddCircle(center,size)
tempPoints = rs.DivideCurve(tempCircle, edges, create_points=False, return_points=True)
tempPoints.append(tempPoints[0])
tempHexago = rs.AddPolyline(tempPoints)
tempReturn = rs.RotateObject(tempHexago, center, angle, axis=None, copy=False)
rs.DeleteObject(tempCircle)
return tempReturn
for i in range(0, levels):
tempSize = work * (i + 1)
dut = polygon(Pts, edges, tempSize, 30 + Hex_RA)
temp = rs.DivideCurve(dut, (i+1) * edges, create_points=False, return_points=True)
rs.DeleteObject(dut)
hexGrid.extend(temp)
for i in range(0, len(hexGrid)):
polygon(hexGrid[i], edges, Hex_EL, Hex_RA)
rs.AddPoint(hexGrid[i])