How recover an object's dimensions? With bge module

Hi,
I have only one object on my scene, and I want to recover its dimensions with the module bge (not with bpy)
For the moment I just sucess to recover its position. See my script:

import bge
import sys

To get the controller thats running this python script:

cont = bge.logic.getCurrentController() # bge.logic is automatically imported

To get the game object this controller is on:

object = cont.owner

#Select the object “Americain football ball”
scene = bge.logic.getCurrentScene()
texte = scene.objects.get(“Americain football ball”)
print ("mon objet selectionné est ", texte)

INITIAL POSITION

#We recover the initial position of the object
initial_position = object.position
print ("sa position est ",initial_position)
#We save the initial position of the object
save_initial_position = initial_position.copy()
print ("la position enregistrée est: ", save_initial_position)

I try object.dimension, object.size but it doesn’t work.
Thanks for your help

Hi

http://www.blenderartists.org/forum/showthread.php?286797-get-Dimensions-of-an-object-using-python

another idea may be to add the original dimension as an object property and keep tabs on scale.

btw object.position is deprecated.

http://www.blender.org/documentation/blender_python_api_2_70_0/bge.types.KX_GameObject.html

PS… you will incur the wrath of the forum admins asking the same q in mutliple forums.

eg http://www.blenderartists.org/forum/showthread.php?332595-Get-dimensions-with-module-bge&goto=newpost

The game engine support and discussion thread (in link 1 above) is your best bet for bge scripting.

Thanks for all this information!
I’m new on this forum

Hi, so I know this is kind of old now, but if anywone is interested I’m working on implementing access from Python API to two new variables: worldDimensions (aliegned with the world axis) and localDimensions (aligned with the local axis).

I managed to add the worldDimensions successfuly, but I noticed I’m building blender 2.68 (or 2.66, can’t remember exactly, but it’s not important) instead of 2.72 (because probably I’m working on ‘ge_dev’). So my question is: what is the correct branch to work on for BGE?

EDIT:
Well, I’ve just submitted a patch, now it just needs to be revised I guess and merged.

Thanks razvanc87 for the Patch. It worked like a charm and this is exactly what I was looking for…