> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ploterr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Model versions

> Move a model saved by an earlier version of Floorkit to the current one, with nothing moved.

## Import

```typescript theme={null}
import {
  migratePlanRotations,
  CCW_ROTATIONS_VERSION,
  migrateHostedOpeningStations,
  SAVED_START_STATIONS_VERSION,
} from '@opengeometry/floorkit';
```

## migratePlanRotations

Move a BuildingModel saved before version 6 to version 6, keeping every column, stair, roof and free door or window where the earlier version drew it.

```typescript theme={null}
function migratePlanRotations(model: BuildingModel): BuildingModel;
```

**Throws:** \{BmEditError} `kernel-unavailable` for a model before version 5 with a turn and a hosted
opening, when the kernel is not initialized.

## CCW\_ROTATIONS\_VERSION

The first BuildingModel version whose plan turns are all counter-clockwise seen from above.

```typescript theme={null}
const CCW_ROTATIONS_VERSION = 6;
```

## migrateHostedOpeningStations

Move a BuildingModel saved before version 5 to version 5, keeping every hosted opening where the earlier version drew it.

```typescript theme={null}
function migrateHostedOpeningStations(model: BuildingModel): OpeningStationMigration;
```

## SAVED\_START\_STATIONS\_VERSION

The first BuildingModel version whose hosted offsets count from the saved start of the wall.

```typescript theme={null}
const SAVED_START_STATIONS_VERSION = 5;
```

## Types

### OpeningStationMigration

```typescript theme={null}
interface OpeningStationMigration {
  model: BuildingModel;
  migrated: MigratedOpeningStation[];
}
```

**model** `BuildingModel` *required*

The model at version 5 when an offset was rewritten; otherwise the input itself, whose openings
stand in the same place by either rule, so it keeps its version.

**migrated** `MigratedOpeningStation[]` *required*

### MigratedOpeningStation

One hosted opening whose saved offset a migration rewrote.

```typescript theme={null}
interface MigratedOpeningStation {
  path: string;
  wallId: string;
  openingId: string;
  from: number;
  to: number;
  clamped: boolean;
}
```

**path** `string` *required*

`$.buildings[b].storeys[s].walls[w].openings[o]`

**wallId** `string` *required*

**openingId** `string` *required*

**from** `number` *required*

The offset as saved by the earlier version.

**to** `number` *required*

The offset that keeps the opening where the earlier version drew it.

**clamped** `boolean` *required*

The place it was drawn at lies off its segment's saved run (inside the wall it joins), so the
offset is held to the end of the segment: the opening moves by the overhang.

## Related

* [`BuildingModel`](https://docs.ploterr.com/floorkit/api/architecture/validate-building-model#buildingmodel)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.