Results 1 to 5 of 5

Thread: Break a Loop?

  1. #1
    I could stop if I wanted to
    Join Date
    2007-02
    Location
    Alexandra, New Zealand
    Posts
    237
    Login to Give a bone
    0

    Default Break a Loop?

    HI.

    I'm wanting to break a continuios loop (in a VB.net dll application that has no GUI forms), when a user hits the escape key. How do I go about listning for the the escape button being pressed.

    Cheers

    Phillip

  2. #2
    Active Member
    Join Date
    2006-08
    Location
    Brisbane : GMT+10
    Posts
    87
    Login to Give a bone
    0

    Default Re: Break a Loop?

    you could try comething like

    Code:
    //did user press ESCAPE? 
     if (HostApplicationServices.Current.UserBreak())
     {
         throw new Autodesk.AutoCAD.Runtime.Exception(
                              ErrorStatus.UserBreak, "ESCAPE pressed");
     }
    as demonstrated here
    http://www.theswamp.org/index.php?topic=29992.0

    /// kdub

  3. #3
    All AUGI, all the time
    Join Date
    2003-10
    Posts
    706
    Login to Give a bone
    0

    Default Re: Break a Loop?

    How can this be used in VB.NET and how would it actually break a loop? Is this placed in the

    "Do Until ..." Statement

    ... or just placed somewhere in the middle of the loop. How would this react with a transaction in progress?

  4. #4
    Member
    Join Date
    2010-06
    Posts
    4
    Login to Give a bone
    0

    Default Re: Break a Loop?


    Code:
    //did user press ESCAPE? 
     if (HostApplicationServices.Current.UserBreak())
     {
         throw new Autodesk.AutoCAD.Runtime.Exception(
                              ErrorStatus.UserBreak, "ESCAPE pressed");
     }
    Hi,
    I just tried to add the statement with the HostApplicationServices above to my .NET VB addin running on Acad 2008.
    But I'm unable to find the given call to the UserBreak().
    Where can I find it?

    Greetings
    René

  5. #5
    Active Member
    Join Date
    2006-08
    Location
    Brisbane : GMT+10
    Posts
    87
    Login to Give a bone
    0

    Default Re: Break a Loop?

    Quote Originally Posted by rene.andreas View Post
    Hi,
    I just tried to add the statement with the HostApplicationServices above to my .NET VB addin running on Acad 2008.
    But I'm unable to find the given call to the UserBreak().
    Where can I find it?

    Greetings
    René
    in 2011 it's in acdbmgd.dll
    Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.UserBreak()

    appears to not be in 2008.

Similar Threads

  1. break out of loop
    By Frank Dux in forum AutoLISP
    Replies: 4
    Last Post: 2014-04-02, 06:34 PM
  2. Annotation - Dynamic Break Line (dyn-break)
    By Kernal_CAD_Monkey in forum Dynamic Blocks - Technical
    Replies: 0
    Last Post: 2012-07-30, 11:28 AM
  3. Dimension Break to Break Lines at Arrowhead
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2008-06-10, 01:20 PM
  4. Replies: 1
    Last Post: 2006-06-13, 06:36 PM
  5. Block Insert Array (Loop within a Loop)
    By wpeacock in forum VBA/COM Interop
    Replies: 2
    Last Post: 2005-06-14, 04:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •