DrawingSketches.add Method

Parent Object: DrawingSketches

PreviewThis functionality is provided as a preview of intended future API capabilities. You are encouraged to use it and report any problems or suggestions using the Fusion API and Scripts forum.

Because this is a preview of future functionality, there is the possibility that it will change, which will possibly break any existing programs that use this functionality. Because of that, you should never deliver any programs that use any preview capabilities. For a distributed program, you should wait until it has moved from preview to released state.


Defined in namespace "adsk::drawing" and the header file is <Drawing/Sketch/DrawingSketches.h>

Description

Creates a new, empty sketch on the sheet and returns it. The sketch is persisted immediately and appears in this collection; add geometry to it through DrawingSketch.lines.

Syntax

"drawingSketches_var" is a variable referencing a DrawingSketches object.

# Uses no optional arguments.
returnValue = drawingSketches_var.add()

# Uses optional arguments.
returnValue = drawingSketches_var.add(name)
"drawingSketches_var" is a variable referencing a DrawingSketches object.

#include <Drawing/Sketch/DrawingSketches.h>

// Uses no optional arguments.
returnValue = drawingSketches_var->add();

// Uses optional arguments.
returnValue = drawingSketches_var->add(name);
"drawingSketches_var" is a variable referencing a DrawingSketches object.

// Uses no optional arguments.
returnValue = drawingSketches_var.add();

// Uses Optional arguments.
returnValue = drawingSketches_var.add(name);

Return Value

Type Description
DrawingSketch Returns the newly created DrawingSketch, or null if the operation failed.

Parameters

Name Type Description
name string The name for the new sketch. Optional; if empty, a default unique name is assigned.

This is an optional argument whose default value is "".

Version

Introduced in version September 2026