Xref Materials - a script to Put materials to scene and creating some geometries

It's been a rough week and i am 90% on having a solid xref scene based workflow...my thanks to everyone who lend me help with their knowledge and patience, soon i might possibly complete an xref scene based workflow and share it with the community.

Anyways,as you may know, you can not interact with an xref scenes so the way to manipulate their materials goes through xref materials.

to those who may lend a hand, i need a script that will.

read the materials inside a .mat file

create chamfered boxes for every material and put them to scene

rename every created box same name as assigned materials name...
all boxed can be put to the 0,0,0 coordinate as all scene management can be done via material names...

thanks you for any input.