Normally one would provide the arguments from LISP and then we'd iterate through the ResultBuffer to check if they are valid/as expected for the method. But how to throw the errors like in these standard LISP functions ? :
I'm looking for something like this guide (https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/exceptions/creating-and-throwing-exceptions) but that would work for ACAD
thrownewSystem.ArgumentException("Parameter cannot be null", "original");
Title: Re: Throwing Errors
Post by: gile on December 02, 2018, 04:12:08 PM
Hi,
AFAIK there's no way to throw standard LISP error from .NET. You can see this topic (https://forums.autodesk.com/t5/net/how-to-cleanly-throw-an-exception-from-lispfunction/m-p/4697127#M38204) and this one (http://www.theswamp.org/index.php?topic=45841.0).
Title: Re: Throwing Errors
Post by: Grrr1337 on December 02, 2018, 04:54:49 PM
Thank you gile! I see some nice coding in these threads.. :)
Just an additional question (as I don't have enough experience), whats more acceptable: • To compile the classes (for instance the one you posted (https://forums.autodesk.com/t5/net/how-to-cleanly-throw-an-exception-from-lispfunction/m-p/4697127#M38204)) onto a separate .dll file and then include it as reference to the main project • To add a new class within the main project (.cs) , and copy-paste the certain sub-library with all the namespaces and classes in there