Automatic regeneration when calling sub

Discussion in 'AutoCAD' started by Arnaud Lesauvage, Feb 15, 2005.

  1. Hi all !

    I don't quite understand the behaviour of autocad's regeneration
    of the drawing.

    I have a sub that I call "test". I use it for testing new vba
    macros because I always have a toolbar button activating it.

    It only contains the code to trigger the sub I am actually working
    on, e.g. :
    Sub test()
    SubCurrentlyInDeveloppement
    End Sub

    When I work that way, the active viewport is automatically
    regenerated after every drawing operation, and that takes a lot of
    CPU time out of my macro.
    However, when I directly call the SubCurrentlyInDeveloppement in
    the toolbar button (that is, without calling it from within
    another Sub), the drawing does not regenerate until I call
    Thisdrawing.Regen activeviewport.

    How is this possible ? I tried to set
    ThisDrawing.SetVariable "LAYOUTREGENCTL", 0
    ThisDrawing.SetVariable "REGENMODE", 0
    in the "test" sub, but it does not change anything !

    How can I just disable drawing regeneration while any macro is
    running, and until it is over ?

    Thanks a lot for helping !

    Arnaud
     
    Arnaud Lesauvage, Feb 15, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.