2024 Method
Changes 0
M

ImportInstance.Create

Description:
Creates a new instance of DWG or DXF link type from a file path and loads the linked file.
Remarks:

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.

public static ImportInstance Create(
	Document document,
	View DBView,
	string path,
	DWGImportOptions options,
	out LinkLoadResult linkLoadResult
)
  • document
    The document in which to create the DWG or DXF link.
  • DBView
    The view into which the DWG or DXF link will be created.
  • String
    path
    The full path of the DWG or DXF file to link. The path must exist and must be a valid DWG or DXF file.
  • options
    Various import options applicable to the DWG format. If nulla null reference (Nothing in Visual Basic), all options will be set to their respective default values.
  • linkLoadResult
    An object containing the results of creating and loading the DWG or DXF link. It contains the ElementId of the new created DWG or DXF link type.
Return Value ImportInstance The new instance of DWG or DXF link type.