I wish to have curve,points,surface,axis selcting and appying layer and color

I’m looking for a code that lets the user manually select curves, surfaces, points, axes, and planes, and then automatically assigns them a specific color and layer through the script