Document.Import
Description:
Imports a DWG or DXF file to the document.
Imports a DWG or DXF file to the document.
Overloads (6):
Import(String,DWGImportOptions,View,ElementId)
public bool Import(
string file,
DWGImportOptions options,
View pDBView,
out ElementId elementId
)
-
fileFull path of the file to import. File must exist and must be a valid DWG or DXF file.
-
optionsVarious options applicable to the DWG or DXF format. If nulla null reference (Nothing in Visual Basic), all options will be set to their respective default values.
-
pDBViewThe view into which the file wil be imported.
-
elementIdThe id of imported instance after a successful import.
Return Value
bool
True if successful, otherwise False.
-
Not a valid file for DWG import (.dwg and .dxf files are valid). -or- ThisViewOnly cannot be true when importing a DWG|DGN drawing into a 3D view -or- One or more strings describing layer selection is invalid or empty. -or- The array of line weights is not valid; either it contains less than expected 255 values, or one or more values are out of range 1 to 16 -or- The scale is not valid as a CustomScale for use during import. -or- NullOrEmpty -or- The view is not printable.
-
A non-optional argument was NULL
-
The given file does not exist.
-
Import is temporarily disabled.
-
The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.
-
The document has no open transaction.
-
The DWG Import/Link module is not available in the installed Revit.