ImportManager.importToNewDocument Method

Parent Object: ImportManager
Defined in namespace "adsk::core" and the header file is <Core/Application/ImportManager.h>

Description

Executes the import operation to import a file (of the format specified by the input ImportOptions object) to a new document.

This method does not support the DXF2DImportOptions or SVGImportOptions objects. Use ImportToTarget or ImportToTarget2 for those types.

Syntax

"importManager_var" is a variable referencing an ImportManager object.

returnValue = importManager_var.importToNewDocument(importOptions)
"importManager_var" is a variable referencing an ImportManager object.

#include <Core/Application/ImportManager.h>

returnValue = importManager_var->importToNewDocument(importOptions);
"importManager_var" is a variable referencing an ImportManager object.

returnValue = importManager_var.importToNewDocument(importOptions);

Return Value

Type Description
Document Returns the newly created Document object or null if the creation failed. A new unnamed, unsaved document will be opened in Fusion 360 as a result.

Parameters

Name Type Description
importOptions ImportOptions An ImportOptions object that is created using one of the create methods on the ImportManager object. This defines the type of file and any available options supported for that file type.

Samples

Name Description
Import Manager API Sample

Demonstrates ImportManager for IGES, STEP, SAT, SMT, Fusion archive (F3D), and DXF 2D import, including importToNewDocument, importToTarget, and ImportOptions.isViewFit.

Before running: The sample paths point at neutral-format test files under Core/Neutron/Test/APITest/ (for example APISampleImportNeutralIgs.igs). When you run the script yourself, either place equivalent files at those paths or edit the file paths in the sample. The automation test uses paths relative to the script via TestUtils. Imports create new documents or add to the active design depending on the section you run.

Version

Introduced in version September 2015