I have a basic code by which im trying to get the center of a number of curves without them sitting on a cplane.
However im currently doing this for each curve in the list manually, i rather just loop it to apply the code to each curve in a list, and then print out the centroid.
I also need to be able to use this centroid values to select specific curves from these lists. Not sure how to go about it, help is so appreciated. My code is down below:
from Rhino.Commands import Result
from Rhino.DocObjects import ObjectType
import rhinoscriptsyntax as rs
from scriptcontext import doc
layer_objs = rs.ObjectsByType(4,True)
#create an empty list
for obj in layer_objs:
#find curves among the objects
#curve meets selection criteria, append to “good” list
bBox = rs.BoundingBox(mylist)
cent = [(bBox + bBox)/2,(bBox + bBox)/2,(bBox + bBox)/2]