Convert Method


Converts the geometry stored in the external format into a collection of Revit geometry objects.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2017

Syntax

C#
public IList<GeometryObject> Convert(
	Document document,
	string filename
)
Visual Basic
Public Function Convert ( _
	document As Document, _
	filename As String _
) As IList(Of GeometryObject)
Visual C++
public:
IList<GeometryObject^>^ Convert(
	Document^ document, 
	String^ filename
)

Parameters

document
Type: Autodesk.Revit.DB Document
The Revit document where the resulting Revit geometry objects will be used. This document may need to be modified to store dependent elements such as graphics styles and/or materials.
filename
Type: System String
The full path to the input file.

Return Value

A collection of Revit geometry objects created from the incoming data.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions FileArgumentNotFoundException The given filename does not exist.
Autodesk.Revit.Exceptions InvalidOperationException Data conversion service is not available.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →