MeshBodies.add Method

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

Description

Creates a new mesh body by importing an STL, OBJ or 3MF file.

Because of a current limitation, if you want to create a mesh body in a parametric model, you must first call the edit method of the base or form feature, use this method to create the mesh body, and then call the finishEdit method of the base or form feature. The base or form feature must be in an "edit" state to be able to add any additional items to it.

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);

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 filename (path and file) of a STL, OBJ or 3MF file.
units MeshUnits The units to use when importing the file.
baseOrFormFeature Base The BaseFeature or FormFeature object that this mesh body will be associated with. This is an optional requirement and is required when the model design history is being captured (parametric model) but is ignored otherwise (direct edit model).

This is an optional argument whose default value is null.

Version

Introduced in version August 2014