You have There are two threads on the same problem (two different op’s), maybe we can concentrate in just one…
Following is a sample that finds the text insertion point inside a closed planar curve and groups the text object with the curve. You can modify it to suit. Note that as it is set up now, if there is more than one text inside a curve, it will only grab the first one - this can also be changed. Note also that the text insertion point is projected to the curve plane for comparison, so it does not actually need to be in the same plane as the curve - just within the projection of it.
import rhinoscriptsyntax as rs
#planar closed curves
def cp_crv_filt(rhino_object, geometry, component_index):
return rs.IsCurvePlanar(geometry) and rs.IsCurveClosed(geometry)
def to_filt(rhino_object, geometry, component_index):
msg="Select closed planar curves to process"
if not crvs: return
msg="Select texts to check"
if not txts: return
txt_data=[(rs.TextObjectPoint(txt),txt) for txt in txts]
for crv in crvs:
for txt_item in txt_data:
#point is automatically projected to the curve plane for testing !!
#items grouped, remove text item from search to go faster
#go to next curve in list