# Editor.MapEditor.Hammer.BuildMap

```csharp
static bool BuildMap(MapBuildPreset preset = 0, bool loadInEngine = False)
```

Compile the active map, as if the user pressed Build in the Build Map dialog with this preset.
The dialog shows the progress. Never prompts to save - save first, the build compiles what's
on disk. Returns false if the build couldn't start; [Editor.MapEditor.Hammer.BuildStatus](/api/Editor.MapEditor.Hammer/BuildStatus) says why.

### Parameters

- `preset` (`MapBuildPreset`), default `0`: What to build.
- `loadInEngine` (`bool`), default `False`: Load the map in engine when it's built, if the dialog is set to.

### Returns

`bool`

Declared in [Editor.MapEditor.Hammer](/api/Editor.MapEditor.Hammer).
Assembly: `Sandbox.Tools`.
