Blender select all vertecies

Hey!:slight_smile:
I got 5 curves and i want to write a script which selects the first curve, converts it into a mesh, switches into Editmode, selects all Vertecies, switches back to objectmode and repeats this for the next 5 objects.

This doesnt work and i dont know why:

import bpy
for i in bpy.context.selected_objects:
bpy.ops.object.convert(target=‘MESH’)
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_all(action=‘TOGGLE’)
bpy.ops.object.editmode_toggle()

Thanks!:slight_smile:

Hi !

The editmode works on active object : in your script, you’re only repeating the operators on the same object (the active one, provided you’ve got one) and not on each object of your selection. Something like this should work :

import bpy


for obj in bpy.context.selected_objects:
    #Set the current object in loop as the active one
    bpy.context.scene.objects.active = obj

    bpy.ops.object.convert(target='MESH')
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.object.mode_set(mode='OBJECT')

It worked, thank you very much!:slight_smile: