Error Object Preview

Derived from: Base Object
Defined in namespace "adsk::electron" and the header file is <Electron/Errors/Error.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

Single design rule check (DRC) or electrical rule check (ERC) error.

Methods

Name Description
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().

Properties

Name Description
code Numeric identifier for the rule or check that was violated (ERC/DRC error code).
description Human-readable message describing this error.
errorType Severity or category of this error (warning, failure, consistency, or airwire).
id Zero-based index of this error within the errors collection.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
layer Layer number (1-based) where the error occurs; 0 for ERC errors.
moduleName Name of the schematic module (sheet or symbol) where the error occurs; empty for DRC.
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():
s1 First string parameter substituted into the error message template (e.g., part name, net name); empty for DRC.
s2 Second string parameter substituted into the error message template; empty for DRC.
s3 Third string parameter substituted into the error message template; empty for DRC.
s4 Fourth string parameter substituted into the error message template; empty for DRC.
s5 Fifth string parameter substituted into the error message template; empty for DRC.
s6 Sixth string parameter substituted into the error message template; empty for DRC.
sheet Sheet number where the error occurs; 0 for DRC.
signature Unique signature string for this error (used for matching, e.g., when approving).
state Approval status of this error (active, processed, or approved).
x X coordinate of the error location, in internal units.
y Y coordinate of the error location, in internal units.

Accessed From

Errors.item

Version

Introduced in version May 2026