ElementDataModel.CreateFileGeometry method (1 of 2)
Creates an instance of FileGeometry using a memory stream. The stream data is written to a temporary file that will be automatically deleted when the FileGeometry is disposed. IMPORTANT: Caller must dispose the returned FileGeometry to avoid resource leaks.
public static FileGeometry CreateFileGeometry(MemoryStream geometryStream, GeometryFormat format,
RenderStyle renderStyle = null, Units units = null, string sourceId = null)
| parameter | description |
|---|---|
| geometryStream | The memory stream containing the geometry data. |
| format | The format of the geometry data. |
| renderStyle | An optional RenderStyle object to define the rendering style. |
| units | An optional Units object to specify the measurement units. |
| sourceId | Optional connector-owned source id, exposed as SourceId and used for lookup via GetGeometryMetaDataById. |
Return Value
Instance of FileGeometry with a temporary file. Caller must dispose to clean up.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when geometryStream is null. |
| ArgumentException | Thrown when format is Unknown. |
See Also
- class FileGeometry
- enum GeometryFormat
- class RenderStyle
- class Units
- class ElementDataModel
- namespace Autodesk.DataExchange.DataModels
ElementDataModel.CreateFileGeometry method (2 of 2)
It will create a instance of FileGeometry with the specified file path and format.
public static FileGeometry CreateFileGeometry(string filePath, GeometryFormat format,
RenderStyle renderStyle = null, Units units = null, string sourceId = null)
| parameter | description |
|---|---|
| filePath | Geometry file path. |
| format | Geometry file format, for example Step, Obj, or Ifc. |
| renderStyle | Renderstyle object. |
| units | Units object. |
| sourceId | Optional connector-owned source id, exposed as SourceId and used for lookup via GetGeometryMetaDataById. |
Return Value
Instance of FileGeometry.
See Also
- class FileGeometry
- enum GeometryFormat
- class RenderStyle
- class Units
- class ElementDataModel
- namespace Autodesk.DataExchange.DataModels