EnumProperty Panel in Blender 2.66

Hi, I want to have an EnumProperty in a Blender 2.66 panel. How do I access the user-chosen value of this property? When I try scene.property_name, it returns the full EnumProperty type, not the currently selected value. Here is the relevant code:

obj_types_enum = [(“N/A”,“N/A”,"",1),(“axon”,“axon”,"",2),(“dendrite”,“dendrite”,"",3),(“synapse”,“synapse”,"",4)]

bpy.types.Scene.obj_type = EnumProperty(name = “objtype”, default = “N/A”, items = obj_types_enum)

class GetComputePanel(bpy.types.Panel):
bl_label = “Geometry Tools”
bl_space_type = “VIEW_3D”
bl_region_type = “TOOLS”
def draw(self, context):
scn = context.scene
self.layout.prop(scn, ‘obj_type’)
if scn.obj_type == “axon”: # this doesn’t work
print(scn.obj_type) # this prints all possible enumerations

Also, what is the Python property type for the “expanded enumeration” used in, for example, the Object properties Duplication panel (with {“None”, “Frame”, “Verts”, “Faces”, “Group”}, each resulting in a different set of following input options)?

I am not seeing any examples of this usage anywhere.

Thanks for your help!

seems fine, if you use bpy.types.Scene and register it in the register() of your script, it should then be available via context.scene.obj_type

there is no expanded enum type, it’s just a different representation of an enumprop:
layout.prop(scn, “obj_type”, expand=True)
should do the trick

That works, thanks CoDEmanX.

I was just about to post the same question. Thanks for your solution CoDEmanX, it is much appreciated as always!