.NET

Reply
Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 11 of 12

Re: Start-up & initialize

06-16-2013 11:05 AM in reply to: BlackBox_

BlackBox_ wrote:
Fair enough; so you're sayin something like:

if (<criteria is not met>)
throw new <?.>Exception();

... Would do the trick?

Yes.  The managed runtime loader will catch any exception thrown.  If the OP wants to inform the user that the commands are not available, he can display a message before throwing the exception.

Distinguished Mentor
787 Posts
80 Kudos
Registered: ‎02-25-2013
Post 12 of 12

Re: Start-up & initialize

06-16-2013 11:50 AM in reply to: DiningPhilosopher

DiningPhilosopher wrote:

BlackBox_ wrote:
Fair enough; so you're sayin something like:

if (<criteria is not met>)
throw new <?.>Exception();

... Would do the trick?

Yes.  The managed runtime loader will catch any exception thrown.  If the OP wants to inform the user that the commands are not available, he can display a message before throwing the exception.


Thank you for clarifying... Perhaps in error, I picked up that this was 'a bad thing' to do in Initialize, and didn't realize one could intentionally employ Exceptions to prevent other assembly code from being loaded.

 

In contrast, I did learn from Gile's LispException helper Classes that one could do so when evaluating a ResultBuffer; I clearly didn't connect the dots.

 

As always, I appreciate the knowledge you share with the community.

 

Cheers



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post