Just starting with scripting in Blender, and the simplest thing seems to not work as I would expect.
I copied the code that creates the standard cube and repeated it, with a z scale factor of 4. I expected this to create a "tall cube" (cuboid) that's 4 times taller than the standard cube, but that's not the case. If the standard cube is 2m x 2m x 2m, the other one is 1m x 1m x 4m (half of what I would expect).
Furthermore, the Item's transform panel says the dimensions are 1x1x4 and the scale is (1,1,1).
Any tips on understanding how that works? The API documentation is really minimal.
Here's a screenshot of the result:
Also, here's the code:
import bpy
bpy.context.area.type = 'VIEW_3D'
bpy.ops.view3d.snap_cursor_to_center()
# Create the default cube
bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False,
align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
bpy.context.object.name = 'Standard'
# Like above with z-scale=4.
bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False,
align='WORLD', location=(4, 0, 0), scale=(1, 1, 4))
bpy.context.object.name = 'Tall'
bpy.context.area.type = 'TEXT_EDITOR'