Cylinder 2 and Cylinder 5 are in the active screen. Manual Boolean Difference works. Following examples from tutorials and stackexchange, I've patched together the following script, which appears to mimic the manual operation:
import bpy from bpy.types import Operator from bpy.props import BoolProperty, StringProperty # need to spend more time on bpy: types, props,data,ops, context xx = 15 while (xx < 16): yy = 15 while (yy < 16): # set the 'cutter' in location bpy.data.objects['Cylinder.002'].location=(xx,yy,0) # make sure that the base object is selected bpy.data.objects['Cylinder.005'].select = False bpy.data.objects['Cylinder.005'].select = True # set the modifier bpy.ops.object.modifier_add(type='BOOLEAN') bpy.context.object.modifiers['Boolean'].operation = 'DIFFERENCE' bpy.context.object.modifiers['Boolean'].object = bpy.data.objects['Cylinder.002'] # execute bpy.ops.object.modifier_apply(apply_as='DATA', modifier='Boolean') yy += 3 xx += 3
(not worrying about my inability to properly paste a code block for the moment)
Run Script produces the following screenshot after interrupting execution:
Aside from help with my immediate problem, would you suggest a particular tutorial on scripting? Thanks.