EcadCommandInput Object Preview

Derived from: Base Object
Defined in namespace "adsk::electron" and the header file is <Electron/Commands/EcadCommandInput.h>

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.

Description

Defines a batch of native Fusion Electronics command strings to execute using EcadDrawing.executeCommands.

Commands use the same syntax as Electronics script files. The Fusion Electronics command reference documents the supported command syntax.

Each command should contain all arguments required for non-interactive execution.

Use EcadDrawing.createCommandInput to create this object.

Methods

Name Description
add

Adds a command to the end of the batch.

The command string is not executed or semantically validated by this method. Command parsing and execution validation occur when EcadDrawing.executeCommands is called.

addRange

Adds multiple commands to the end of the batch in the order given.

The command strings are not executed or semantically validated by this method. Command parsing and execution validation occur when EcadDrawing.executeCommands is called.

classType

Static function that all classes support that returns the type of the class as a string. The returned string matches the string returned by the objectType property. For example if you have a reference to an object and you want to check if it's a SketchLine you can use myObject.objectType == fusion.SketchLine.classType().

clear

Removes all commands from the batch.

item

Returns the command at the specified index.

Properties

Name Description
count Gets the number of commands currently in the batch.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
objectType This property is supported by all objects in the API and returns a string that contains the full name (namespace::objecttype) describing the type of the object.

It's often useful to use this in combination with the classType method to see if an object is a certain type. For example: if obj.objectType == adsk.core.Point3D.classType():
rollbackOnError Gets and sets whether changes made by the batch are discarded when the batch does not complete successfully.

The default value is true.

When true and execution fails, all changes made by commands in this batch are rolled back and EcadCommandBatchResult.rolledBack is true.
stopOnError Gets and sets whether command execution stops after the first command that does not complete successfully.

The default value is true.

When true, commands following a failed command are not executed and their EcadCommandResult status is NotExecutedEcadCommandStatus.

When false, execution continues with subsequent commands when it is safe to do so.

Accessed From

Board.createCommandInput, EcadDrawing.createCommandInput, Library.createCommandInput, Schematic.createCommandInput

Version

Introduced in version November 2026