DrawingViewSketches.add Method

Parent Object: DrawingViewSketches

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/DrawingViewSketches.h>

Description

Creates a new, empty view sketch anchored to the owning drawing view and returns it. The sketch is persisted immediately and appears in this collection; add geometry to it through the geometry collections on the sketch (for example lines). Mirrors the View Sketch command.

Syntax

"drawingViewSketches_var" is a variable referencing a DrawingViewSketches object.

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

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

#include <Drawing/Sketch/DrawingViewSketches.h>

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

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

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

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

Return Value

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

Parameters

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

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

Version

Introduced in version November 2026