GeometryConversionExtensions.AsStreamGeometryAsync method (1 of 2)
Asynchronously converts an ElementGeometry to a StreamGeometry by reading the file data into memory.
public static Task<StreamGeometry> AsStreamGeometryAsync(this ElementGeometry elementGeometry,
CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| elementGeometry | The ElementGeometry to convert. Must be a FileGeometry. |
| cancellationToken | Cancellation token for the async operation. |
Return Value
A task that resolves to a StreamGeometry containing the file data in memory.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when elementGeometry is null. |
| ArgumentException | Thrown when elementGeometry is not a FileGeometry. |
| FileNotFoundException | Thrown when the file does not exist. |
See Also
- class StreamGeometry
- class ElementGeometry
- class GeometryConversionExtensions
- namespace Autodesk.DataExchange.Extensions
GeometryConversionExtensions.AsStreamGeometryAsync method (2 of 2)
Asynchronously converts a FileGeometry to a StreamGeometry by reading the file data into memory.
public static Task<StreamGeometry> AsStreamGeometryAsync(this FileGeometry fileGeometry,
CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| fileGeometry | The FileGeometry to convert. |
| cancellationToken | Cancellation token for the async operation. |
Return Value
A task that resolves to a StreamGeometry containing the file data in memory.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when fileGeometry is null. |
| FileNotFoundException | Thrown when the file does not exist. |
See Also
- class StreamGeometry
- class FileGeometry
- class GeometryConversionExtensions
- namespace Autodesk.DataExchange.Extensions