I believe this is only possible with an add-on.
If you have RTB you can use the saveBricks(); command. Type that in as I did above and it'll give an example of how to use it.