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

cancelling loops with a right-click or escape

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
374 Views, 2 Replies

cancelling loops with a right-click or escape

I'm new to programming .NET for AutoCAD, but have experience with .NET and AutoLISP.
My question is I have two nested loops in which the user first makes a single selection which then puts him in the inner loop where he select objects at will until he is done and the either presses the escape key or right clicks with his mouse. This then puts him back in the outer loop where he can select another single item and enter the inner loop again or press escape or right click to end the program.
How can I catch these two events in .NET?

Ben
2 REPLIES 2
Message 2 of 3
NathTay
in reply to: Anonymous

If you are using the GetEntity method you can check the Status property of the returned PromptEntityResult object.

Regards - Nathan
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks Nathan,

I am using the GetEntity method and found that both a right click and an escape generate an error situation that I can trap. I then checked the error number and with an "If... Then... Else..." exited the loops as required.

I tested it out yesterday and it works fine now.

Thanks for your response.

Regards
Ben

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