.NET

.NET

Reply
Contributor
17 Posts
0 Kudos
Registered: ‎10-23-2006
Post 1 of 3

cancelling loops with a right-click or escape

157 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
1,691 Posts
3 Kudos
Registered: ‎12-15-2003
Post 2 of 3

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
17 Posts
0 Kudos
Registered: ‎10-23-2006
Post 3 of 3

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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!