Read the Fallout Editor document which is coming together with the official Fallout mapper. There you'll find a command for it.
Other than that, you could browse the source scripts which come with the official Fallout mapper and see how the guys from BIS did it.