To keep it as simple as possible, I use what ever is selected in the model. Unfortunately SketchUp's selection tool doesn't select materials and layers. I haven't yet decided how to expose other entities in the UI.
AttributeInspector has an API: You can type in a Ruby Console:
entity = Sketchup.active_model.materials[0] AE::AttributeInspector.select(entity)
or
entities = Sketchup.active_model.layers.to_a AE::AttributeInspector.select(entities)