AutoCAD always has numerous undocumented commands, and here is one that I missed when I scoured AutoCAD 2007 earlier this year for my "The Illustrated AutoCAD 2007 Quick Reference" book (Autodesk Press).
I had found it curious that AutoCAD 2007 has a MaterialAttach command for attaching materials to layers, but no command for attaching materials to objects. (The workaround is to drag materials from the Tool palette onto the object.)
By accident this evening, I typed in MaterialAssign and found it works like this:
Notice that the paintbrush cursor appears.
Select objects: (Pick one or more objects.)
Select objects or [Undo]: (Press Enter to exit the command.)
Hmm... it never asked which material to assign to the objects. It turns out that this command uses whichever material is stored in the CMaterial system variable. When changing the value of this system variable, you have to use quotation marks when the material name contains spaces, like this:
Enter new value for CMATERIAL <"ByLayer">: "Metals.Structural Metal Framing.Steel"
In the end, it is easier to just drag materials off the Tool palette and onto objects.