from bpy import data, ops, context, types, props
def addcubes():
## assuming this is going to happen in object mode
## bcoz even if you add lots of objects every thing is going to be same
for each in range(10):
loc = 3*each
## format the name to show your choice of name
name = 'MyObject'+str(each+1)
ops.mesh.primitive_cube_add(location = ( loc , 0 , 0 ))
## here is our boss
## because added object will be the current active one
context.active_object.name = name
if __name__ == '__main__':
addcubes()
context.active_object.name = name
and just make my name a little like you did instead of the sequence number 001 or 002 ect
which i find difficult to deal with afterward!
join
also inside at the end of the loop is there a way to join all the objects created in the loop to make on big object
like join the before last and the last one created
i wish i could show a pic here but not allowed !
i’m dong a meter scale with all the markers so i may get 100 markers which would be nice to have all in one object not 100 !LOL