---
title: "export(to:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlasset/export(to:)"
---

# export(to:)

Writes asset data to a file at the specified URL and reports errors that occur during export.

## Declaration

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

## Parameters

- `URL`: A URL specifying the location to export asset data to. This parameter must be a file: URL.

## Discussion

Discussion The MDLAsset class infers the data format to export in from the pathExtension property of the specified URL. To determine whether a format is supported for export, call the canExportFileExtension(_:) method.

## See Also

### Exporting an Asset

- [canExportFileExtension(_:)](modelio/mdlasset/canexportfileextension(_:).md)
