Import |
public static ImportInstance Create( Document document, View DBView, string path, DWGImportOptions options, out LinkLoadResult linkLoadResult )
Exception | Condition |
---|---|
ArgumentException | document is not a project document. -or- document is in an edit mode. -or- Import is temporarily disabled. -or- The view is not printable. -or- NullOrEmpty -or- 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 line weights are not valid; either it contains an invalid number of line weights, or a line weight outside the valid range. -or- The scale is not valid as a CustomScale for use during import. |
ArgumentNullException | A non-optional argument was null |
FileArgumentNotFoundException | The given path does not exist. |
InvalidOperationException | Place by shared, and the host model and the link do not share the same coordinate system. Or place by shared, and the shared coordinates of the host model do not match the GIS coordinate system of the link. |
ModificationForbiddenException | 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. |
ModificationOutsideTransactionException | The document has no open transaction. |
OptionalFunctionalityNotAvailableException | The DWG Import/Link module is not available in the installed Revit. |
This function creates a new DWG or DXF link type as well as a new instance of this link type. The new instance of DWG or DXF link type is returned by this function and the element id of the new DWG or DXF link type is contained in the LinkLoadResult.
If the given full path of the DWG or DXF file to link is already used by an existing DWG or DXF link type, a new instance of this existing DWG or DXF link type will be created and returned. The element id of the existing DWG or DXF link type is contained in the LinkLoadResult.
This function regenerates the input document.