.NET

Reply
Contributor
Tyke
Posts: 17
Registered: ‎10-23-2006
Message 1 of 3 (154 Views)

cancelling loops with a right-click or escape

154 Views, 2 Replies
10-23-2006 08:52 AM
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
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 2 of 3 (154 Views)

Re: cancelling loops with a right-click or escape

10-23-2006 03:54 PM in reply to: Tyke
If you are using the GetEntity method you can check the Status property of the returned PromptEntityResult object.

Regards - Nathan
Contributor
Tyke
Posts: 17
Registered: ‎10-23-2006
Message 3 of 3 (154 Views)

Re: cancelling loops with a right-click or escape

10-24-2006 08:03 AM in reply to: Tyke
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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.