# 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?

• Looks good. How your callback looks like? What exactly is wrong with this? From the API: update is called when this value is modified – p2or Oct 22 '16 at 17:19
• @poor, The callback was exactly my problem. I had initially no idea how to do it. But i have meanwhile solved it. See answer below :) – Tiles Oct 22 '16 at 17:28
• I'd avoid update, that's why I posted the API quote. – p2or Oct 22 '16 at 18:31
• Yes, that's what i did in the end then :) – Tiles Oct 22 '16 at 18:34

def myindex(self, context):