MeshBodies.add Method

Parent Object: MeshBodies
Defined in namespace "adsk::fusion" and the header file is <Fusion/MeshBody/MeshBodies.h>

Description

Creates new mesh bodies by importing an STL, OBJ, or 3MF file into the parent component.

In a parametric design, a new mesh base feature is created automatically for the imported bodies. You do not need to call the edit or finishEdit methods of a base or form feature before or after calling this method.

Syntax

"meshBodies_var" is a variable referencing a MeshBodies object.

# Uses no optional arguments.
returnValue = meshBodies_var.add(fullFilename, units)

# Uses optional arguments.
returnValue = meshBodies_var.add(fullFilename, units, baseOrFormFeature)
"meshBodies_var" is a variable referencing a MeshBodies object.

#include <Fusion/MeshBody/MeshBodies.h>

// Uses no optional arguments.
returnValue = meshBodies_var->add(fullFilename, units);

// Uses optional arguments.
returnValue = meshBodies_var->add(fullFilename, units, baseOrFormFeature);
"meshBodies_var" is a variable referencing a MeshBodies object.

// Uses no optional arguments.
returnValue = meshBodies_var.add(fullFilename, units);

// Uses Optional arguments.
returnValue = meshBodies_var.add(fullFilename, units, baseOrFormFeature);

Return Value

Type Description
MeshBodyList Returns a list of the newly created mesh bodies or null if the creation failed. Multiple bodies can be created in the case where a .obj file that contains multiple bodies was imported. STL files always contain a single body.

Parameters

Name Type Description
fullFilename string The full path to an STL, OBJ, or 3MF file.
units MeshUnits The length units used to interpret coordinate data in unitless STL and OBJ files. This argument does not change the scale of 3MF files that define their own units.
baseOrFormFeature Base Optional. Does not assign bodies to the specified feature. In a parametric design, imported bodies are always placed in a newly created mesh base feature. For backwards compatibility, providing this parameter forces the same behavior during BaseFeature.startEdit.

This is an optional argument whose default value is null.

Version

Introduced in version August 2014