adding a primitive cube ?

seems that some changes have been done

can somone tell me how to add a cubw primitive now

before this was working fine

import bpy
from bpy import *
xrnd1=0
yrnd1=0
zrnd1=0

myCubeMesh =bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(xrnd1, yrnd1, zrnd1), layer=[True]+[False]*31)
]

Just change the 31 to 19. You only need to supply 20 layers now.

well i was hoping to get 32 layers instead of 20

but may be later fro 2.5 ?

Thanks

i tried this example

and does not gie any error
but does not add a cube !

import bpy
add_cube = bpy.ops.mesh.primitive_cube_add
layers = [False]*19

what’s wrong with this?

and ounce adde does it bcomes the active object automatically ?

$$$$$$$$$$$$$$$$$

i got another old example which is not working anymore

import bpy
sc = bpy.context.scene
obact = sc.objects[‘Cube’]
bpy.ops.transform.rotate( 1.2,(0,1,0))

how can this made to work again ?

error on float needs string now but how to write it down ?

Thanks

This works (e.g.)


import bpy
res = bpy.ops.mesh.primitive_cube_add()
print("res=",res)
bpy.ops.transform.rotate( value=(4,),axis=(0,1,3))

ok this is using the BPY.ops which are the operators
i found the object page for theses ops and it allows to do a few other things also

but still looking for an example for the scale and locate did not see the locate on that page!

but there is also another way to do this with the BPY.type commands

any example using theses commands and what the hierarchie of API pages are for theses

at least i’d be able to understand what and where to look for theses!

i’m trying to add a plane scale it in X and Y then re locate it and rotate it at the new location
doing like an arc segment of a cirlcel to make a meter’s scale with some markers and sub division markers

i need that to make all king of meters scale for airplane boat or other instruments using analogue meters - it would be faster then dong it manullay each time cause there are so many different type of old meters
i know now a day analogue meters are not used anymore being replace with digital one or on PC using GUI i guess!
but still usefull for old machines models

Thanks and happy 2.5