Skip To Content

Schema.ImportAsync (.NET)

The Schema.ImportAsync method imports the ArcGIS for AutoCAD schema from another .dwg or .dwt file, or a feature service. When importing from a .dwg or .dwt file, the schema information includes the document feature layer definitions, domains, subtypes, AutoCAD layers, and AutoCAD blocks. When importing from a feature service, the schema information includes the document feature layer definitions and the Esri coordinate system definition.

Declaration

public async Task<bool> Esri.ArcGISForAutoCAD.Schema.ImportAsync(Document doc, string importPath)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

Required

string

importPath

The file path or service URL that will be used to import the schema.

Required

Returns

TypeDescription

bool

true if the schema was imported successfully

Remarks on error conditions

This method may throw an exception or return false or null if a parameter is invalid.

Example

Print the success of importing the schema from a local drawing.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var importPath = @"C:\GISData\Olympia.dwg";

// Import the schema
var success = await Esri.ArcGISForAutoCAD.Schema.ImportAsync(doc, importPath);

// Print the success
doc.Editor.WriteMessage(success.ToString());

/* Example output 
True
*/