---
title: "export(to:)"
framework: usdkit
role: symbol
role_heading: Instance Method
path: "usdkit/usdlayer/export(to:)-7vouy"
---

# export(to:)

Writes the layer’s contents to a file at the given URL.

## Declaration

```swift
func export(to url: URL) throws
```

## Parameters

- `url`: The destination file URL.

## Discussion

Discussion note: An error if the layer cannot be written.

## See Also

### Exporting and importing

- [export(to:)](usdkit/usdlayer/export(to:)-5hboj.md)
- [importContents(from:)](usdkit/usdlayer/importcontents(from:)-2ipug.md)
- [importContents(from:)](usdkit/usdlayer/importcontents(from:)-99hnf.md)
