ImportManager.importToTarget 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) into an existing component in an existing design.

There is currently a limitation with this method where it cannot be used within any of the Command related events.

Syntax

"importManager_var" is a variable referencing an ImportManager object.

returnValue = importManager_var.importToTarget(importOptions, target)
"importManager_var" is a variable referencing an ImportManager object.

#include <Core/Application/ImportManager.h>

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

returnValue = importManager_var.importToTarget(importOptions, target);

Return Value

Type Description
boolean Returns true if the import was successful.

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. Supplying a DXF2DImportOptions object will result in the creation of one or more sketches (depending on the layers in the DXF file) in the target component.
target Base For most import types this will be a Component. For SVGImportOptions this is the sketch you want to import the SVG data into.

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