required a code for an assembly to move all the parts into one layer and all the dimensions into one layer.

i need help to write a code for layer concept for an assebly as well as drawing sheet.
requirements:
all the parts into one layer
all the hatch into one layer
all the dimensions into one layer
all the text into one layer
all the tables into one layer.