---
title: "replaceAll(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/scene/anchorcollection/replaceall(_:)-tris"
---

# replaceAll(_:)

Replaces the existing anchor collection with a provided collection.

## Declaration

```swift
@MainActor @preconcurrency func replaceAll(_ entities: [any HasAnchoring])
```

## Parameters

- `entities`: An array of anchors to replace the existing collection.

## Discussion

Discussion This method removes all anchors currently in the collection, then appends all the elements in entities to the collection.

## See Also

### Replacing anchors

- [replaceAll(_:)](realitykit/scene/anchorcollection/replaceall(_:)-5t195.md)
