Get current item value from a dropdown menu? I have a dropdown box. And i want to do this when this item is selected, and that when another item is selected. So i need a way to retreive what is currently selected in the dropdown menu.

The dropdown menu is a EnumProperty. Like the dropdown box to change the rotation mode.

bpy.types.Scene.enumprop = bpy.props.EnumProperty(items = item_cb)
...

layout.prop(scene, 'enumprop', text='Files')


How do i retreive the value of the current selection from a dropdown menu by code?
The solution was to add a update to the prop. Then i can retreive changes from the dropdown box.

def myindex(self, context):
    print('changed to,', context.scene.MyEnum)
...

bpy.types.Scene.MyEnum = bpy.props.EnumProperty(items = item_cb, update = myindex)  


Another way goes directly across int(context.scene.MyEnum). Then i don't need the update.