CLEAN COMMAND INTERFACE FROM VBA

Discussion in 'AutoCAD' started by diAb0Lo, Jul 6, 2004.

  1. diAb0Lo

    diAb0Lo Guest

    IS THERE A WAY TO CLEAN TE COMMAND INTERFACE (YOU KNOW WHERE TYPES THE COMMAND) FROM VBA?
     
    diAb0Lo, Jul 6, 2004
    #1
  2. diAb0Lo

    Ed Jobe Guest

    Are you wanting to clean just the current line, or the whole history since they started editing the dwg?
     
    Ed Jobe, Jul 6, 2004
    #2
  3. diAb0Lo

    diAb0Lo Guest

    send me both ways... I will be glad to you
     
    diAb0Lo, Jul 6, 2004
    #3
  4. diAb0Lo

    Anne Brown Guest

    These two posts are in answer to "Clean command interface from
    VBA" but attached to a different thread. Copying them here for
    clarity.
    --
    ---
    Anne Brown
    Discussion Groups Administrator
    Autodesk, Inc.

    =================

    Subject:
    Re: System variables - VBA
    Date:
    Tue, 6 Jul 2004 10:31:44 -0700
    From:
    "Ed Jobe" <>
    Newsgroups:
    autodesk.autocad.customization.vba


    
    Starting with 2000, you can't control the contents of the text
    window. It saves the last 400 lines. You can only control whether
    the content
    is saved to a *.log file. You can clean the current prompt by
    sending another promt line to the command line, thus forcing the
    one you
    don't like further back in the command history. Here's a function
    I wrote to handle sending prompts

    Sub CommandLine(msg As String)
    ThisDrawing.Utility.Prompt (msg & vbCrLf & "Command: ")
    End Sub

    To clear the last prompt, use:
    CommandLine ""

    ***
    Subject:
    Re: System variables - VBA
    Date:
    Tue, 6 Jul 2004 13:14:56 -0500
    From:
    "MP" <>
    Newsgroups:
    autodesk.autocad.customization.vba

    
    what about
    (defun CmdHistLines( / numlines i)
    (setq numlines(Getint"\nNumber of lines"))
    (setq i 0)
    (setenv"CmdHistLines"(itoa numlines))

    ;to test
    (repeat(atoi(Getenv"CmdHistLines"))
    (print(setq i(1+ i))))
    )
    4000 used to be the upper limit
    now(a2k5) 2048 seems to be the max

    Starting with 2000, you can't control (snip)
     
    Anne Brown, Jul 6, 2004
    #4
  5. Hi,

    Try this.

    I use variations of it in all the Menufile.MNL files I create and call it
    from all functions.

    (defun CADAppsCleanCommandLine (spFunctionString)
    (setq n (strlen spFunctionString))
    (repeat n (princ (chr 8))) (repeat n (princ (chr 32)))
    (princ)
    )

    Typical function:

    (defun C:SelectRoad ()
    (setq pbProgName (strcat spbARDRoadProgram "SelectRoad"))
    (vl-vbarun pbProgName)
    (CADAppsCleanCommandLine pbProgName)

    ) ; end Defun SelectRoad


    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Jul 7, 2004
    #5
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.