Labeling geometry

I’m trying to count a bunch of geometry and label it. If I had for example an array of 100 circles and I wanted rhino to generate a label for each with a sequential number how would I go about doing that?

Hi Owen, you might try below python code for a start:

import Rhino
import rhinoscriptsyntax as rs

def circle_filter(rhino_object, geometry, component_index):
    if isinstance(geometry, Rhino.Geometry.ArcCurve):
        if geometry.IsCompleteCircle: return True
    return False
    
def LabelCircles():
    msg = "Select circles to label"
    ids = rs.GetObjects(msg, 4, True, True, False, None, 1, 0, circle_filter)
    if not ids: return

    height = 1.0
    font = "Arial"
    font_style = 0
    justification = 2 + 131072

    for x, id in enumerate(ids):
        curve = rs.coercecurve(id, -1, True)
        rc, circle = Rhino.Geometry.Curve.TryGetCircle(curve)
        if not rc: continue
        text = "MyCircle {}".format(x+1)
        rs.AddText(text, circle.Plane, height, font, font_style, justification)
    
LabelCircles()

c.

I’ve got Mac Rhino here at work and it’s not playing so nice with python at the moment. I’ll try it on my windows version tonight. Thanks though.