Use python to make Box A smaller than Box B by fixed number? I'm trying to write a python script that will make Box A smaller than Box B in dimensions by a fixed number. I started off by making Box A the same size as box B with the script below.

My issue is that I can't seem to make the dimensions of Box A equal to the size of Box B minus e. g 1. If I use x-1,y-1 for my new size for o.dimensions, both boxes are affected and both seem to become some median size of the two. 

import bpy

context = bpy.context

for o in context.selected_objects:

    x = context.object.dimensions.x

    y = context.object.dimensions.y

    z = context.object.dimensions.z

    o.dimensions = [x,y,z]

    o.location = context.object.location
context.object is also part of the context.selected_objects collection.

So here's what you can do:

import bpy
context = bpy.context

objs = [o for o in context.selected_objects if o != context.object]
for o in objs:

    x = context.object.dimensions.x

    y = context.object.dimensions.y

    z = context.object.dimensions.z

    o.dimensions = [x,y,z]

    o.location = context.object.location