This is a bounding box.
bpy.data.objects[name].bound_box, these points are given in this exact order. At least up to 2.79.
If the front face of your wall faces towards Y, then width is
(p0 - p4).length, and thickness is
(p0 - p3).length. Turn it the other way around if your wall faces towards X.
In upbge you could calculate these points on the fly with the min and max values of an objects
cullingBox attribute. Point 0 being
(min, min), whereas point 4 is
(max, min) and point 3
(min, max). Note I’m discarding the Z as unless you also need to calculate how tall the wall is (or if it rotates weird like that), you can ignore it.
But if you’re not on upbge, or you just want to know these values beforehand rather than do the calculation at runtime, you can just get them. Write down a tool script that performs the calculation, select an object to operate on, hit the run script button, and done.
Ah, alright. Here, let me write the tool for you.
import bpy; from mathutils import Vector;
ob = bpy.context.object;
bounds = ob.bound_box;
p0, p3, p4 = Vector(bounds), Vector(bounds), Vector(bounds);
if "thickness" not in ob.game.properties:
if "width" not in ob.game.properties:
ob.game.properties["thickness"].value = (p0 - p3).length;
ob.game.properties["width" ].value = (p0 - p4).length;
Now it’s a game property so you can just go
object["thickness"] when you need it.
Hope some of this is useful.
Vector.length is not a callable. My bad.