Toggle Edit Mode and Toggle Selection Mode

Ok so for some reason I can’t find how to toggle between edit mode and object mode (in python obviously).

Also I can not figure out how to switch between face/edge/vertex selection mode.

Im sure many people know the answer and help would be greatly appreciated. Thank in advance.

Hi, try this: Info at startup only shows ONE line, but you can drag it to ‘below’.
Than you can see what an action does: e.g. edit mode! go back and forth with the cube edit obj and you see the Python -command occurring!
E.g.: bpy.ops.object.editmode_toggle()

Select is a property of your object. vertices have “…”.select = True or False possible …
and to see it you may have to go back and forth (edit object mode) …

import bpy
bpy.ops.object.mode_set(mode=‘OBJECT’)
bpy.ops.object.mode_set(mode=‘EDIT’)

or

bpy.ops.object.editmode_toggle()

2 Likes

thank both of you guys