import rhinoscriptsyntax as rs
x = 100.0 # Width / 2
r = 90 # Cylinder radius
s = .9995 # Scale of the next box
# Cylinders
cylinder = rs.AddCylinder((0, 0, -x), 2 * x, r)
rs.RotateObject(cylinder, (0, 0, 0), 90, (1, 0, 0), copy=True)
rs.RotateObject(cylinder, (0, 0, 0), 90, (0, 1, 0), copy=True)
# Box
cube = rs.AddBox(((-x, -x, -x), (x, -x, -x), (x, x, -x), (-x, x, -x),
(-x, -x, x), (x, -x, x), (x, x, x), (-x, x, x)))
# Drill holes
for i in range(3):
cube = rs.BooleanDifference(cube, rs.AllObjects()[1])
# Create a block instance
rs.AddBlock(cube, (0, 0, 0), 'cube', delete_input=True)
# Insert block instances
for i in range(1000001):
rs.InsertBlock('cube', (0, 0, 0), scale=(s**i, s**i, s**i))