First, download the save editor, then:
- In-game press ctrl+shift+L
- Open the console (press ~)
- Type "ShowDebug" (without quotes)
- In the top-left corner you will see your position
- To mass dismantle, you need to write down the coordinates of the polygon you want to dismantle (can be any shape, but usually rectangle) in clockwise order. Use "ShowDebug Reset" in the console to hide the overlay when you're done.
- Open the save in the save editor and from the cheats menu, select Mass Dismantle, and input the coordinates in clockwise order without decimals (units are centimeters, so decimals are not important anyway)
- Write the minimum and maximum Z values (e.g. you have multiple floors and only want to delete one of them), or leave empty to delete all floors of the factory
- It will take a while to check each object if it is in bounds, but when it's done it says how many buildings were dismantled, and asks if you want the items being dropped in a crate (a lot of items) right next to your character (or your friends if you are playing multiplayer)
- Enjoy not needing to manually dismantle the factory!
Alternatively, you can get the coordinates from a save viewer
Warning: if a slot of the crate has more than a stack of items, do not drag it, or it will become exactly one stack. Use take all button, shift click or ctrl+drag to inventory