Trying to create a box 2x4x2 2 units below an existing point

rhino
help
python
scripting

#1

i am trying to find objects in a layer with “Light” in the name i then need to create points at the center of the objects(boxes) and create coresponding boxes 2x4x2 exactly 2 units below the center point found on the objects in the layer i need to make those objects on a specific layer named “Flicker Evaluation”

anything helps!!!

thanks

import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs

    search_string = "Light"
    for layer in sc.doc.Layers:
        if search_string.lower() in layer.Name.lower():
            for rh_obj in sc.doc.Objects.FindByLayer(layer):
                if rs.IsSurface(rh_obj.Id):
                    rc = rs.SurfaceAreaCentroid(rh_obj.Id)

(Dale Fugier) #2

Hi @Christopher_Gornall,

This may not be what you want. But it might be a good starting point for you.

TestChristopher.py (2.6 KB)

– Dale