ErrorStack collection

AutoCAD Map 3D ActiveX

ErrorStack collection

A collection of ErrorEntry collections.

Each ErrorEntry collection represents AutoCAD Map Automation API error.

Contained by the AcadMap object.

Use the ErrorStack and ErrorEntry collections to manage diagnostic messages, either system- or user-generated, when an error occurs in executing the AutoCAD Map Automation API. You add your own messages to the error stack using the Add method. You get the LastErrCode property immediately after an error occurs to read the last error code generated.

The following example adds a nonexistent file to the drawing set and shows how to display all messages in the error stack.

For more information, click .

Dim amap As AcadMap

Dim prj As Project

Dim i As Long

Dim strOutput As String

Dim ee As ErrorEntry

On Error GoTo ErrHandler

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

prj.DrawingSet.Add ("c:\\nofile.dwg")

Exit Sub

ErrHandler:

For Each ee In amap.ErrorStack

strOutput = strOutput & ee.ErrMessage & Chr(13) 

Next

MsgBox strOutput