GeometryConversionExtensions.AsFileGeometryAsync method
Asynchronously converts a StreamGeometry to a FileGeometry by writing the stream data to disk.
public static Task<FileGeometry> AsFileGeometryAsync(this StreamGeometry streamGeometry,
string outputPath, CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| streamGeometry | The StreamGeometry to convert. |
| outputPath | The file path where the geometry data will be written. |
| cancellationToken | Cancellation token for the async operation. |
Return Value
A task that resolves to a FileGeometry pointing to the written file.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when streamGeometry is null. |
| ArgumentException | Thrown when outputPath is null, empty, or whitespace. |
| IOException | Thrown when the file cannot be written. |
See Also
- class FileGeometry
- class StreamGeometry
- class GeometryConversionExtensions
- namespace Autodesk.DataExchange.Extensions