From the course: AutoCAD: Building Add-ins with C#

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

How to use error trapping

How to use error trapping - AutoCAD Tutorial

From the course: AutoCAD: Building Add-ins with C#

Start my 1-month free trial

How to use error trapping

- [Instructor] So far, we've written simple code. We've written the code together, everything's worked out quite well. However, as we get more complex with our functionality and as we begin to write our own code outside of any tutorials that've been done, and especially when we begin to interact with the user more, we really need to learn how to trap and address errors in a dignified way. So that's what we're gonna focus in on in this video. Let's go ahead and open up our exercise for this video. Desktop, exercise files, chapter three, and the oh three oh four solution. Once the solution opens, we get to our initialization class, get to our commands, and you'll see that the LI loops command is there at the very end. And we're going to just make some adjustments to this second loop. This second loop is the one that kinda walks backwards that we built in our last video. And what we're going to add, we're going to add the try catch statement. So there's the try. And so what happens is…

Contents