.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catching Exceptions

1 REPLY 1
Reply
Message 1 of 2
odoshi
275 Views, 1 Reply

Catching Exceptions

Hello,

I have 2 functions that do the same thing, calling ReadDwgFile().

One function is a LispFunction and the other is a CommandMethod which calls a dialog.

The LispFunction version will not catch the exception when I wrap ReadDwgFile in a try/catch, but the CommandMethod function will.

Is this because I am calling the LispFunction from LISP, and it just cannot handle those errors? I am trying to catch corrupt drawings on Open during a batch process, and if I hit one 50% into the batch, I lose AutoCAD.

Thanks,
Mike Caruso
Autodesk Certified Instructor 2014
AutoCAD/Civil 3D Autodesk Certified Professional 2014, 2015, 2018
www.whitemountaincad.com
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: odoshi

Can you post some code showing this?

I don't see any reason why an exception is not trapped by code that's called
from LISP, except possibly because of the execution context.

Is the code that's not called from LISP running in the document context or
in the application context (e.g., called from a modeless dialog)?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6283612@discussion.autodesk.com...
Hello,

I have 2 functions that do the same thing, calling ReadDwgFile().

One function is a LispFunction and the other is a CommandMethod which calls
a dialog.

The LispFunction version will not catch the exception when I wrap
ReadDwgFile in a try/catch, but the CommandMethod function will.

Is this because I am calling the LispFunction from LISP, and it just cannot
handle those errors? I am trying to catch corrupt drawings on Open during a
batch process, and if I hit one 50% into the batch, I lose AutoCAD.

Thanks,

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost