vba not loading

Discussion in 'AutoCAD' started by jackie, Feb 27, 2004.

  1. jackie

    jackie Guest

    This is my acad.lsp
    -------------------------------------------------------
    (defun S::STARTUP()
    (command "_-vbarun" "initiateMe")
    (load "c:/Process.vlx")
    )
    -------------------------------------------------------

    I set up my Acad 2002 to load acad.lsp every time it starts a drawing.

    Most of the times, acad.lsp loads fine as shown below.
    -------------------------------------------------------
    AcadDoc.Lsp loaded ...
    AutoCAD menu utilities loaded._-vbarun
    Command:
    Macro name: initiateMe
    Command:
    -------------------------------------------------------

    Some times, acad.lsp does not load as shown below.
    -------------------------------------------------------
    AcadDoc.Lsp loaded ...
    AutoCAD menu utilities loaded._-vbarun
    Command:
    -------------------------------------------------------

    As you may notice, it does not show:
    ----------------------------
    Macro name: initiateMe
    Command:
    ---------------------------

    Problem seems to lie with "_-vbarun".
    When this happens, acad hangs in there with no activity. If try to do some
    thing or close acad, popup windodw says there is still a command active, and
    it does not accept any other command. The only thing to do it to CTR + ALT
    +DEL to terminate acad.

    Can any one have a solution or get-around?

    Thanks.
     
    jackie, Feb 27, 2004
    #1
  2. jackie

    RCRuiz Guest

    Hi.
    First load the proyect then run the macro

    (vl-vbaload "C:\\acad2002\\plans\\drawshape.dvb")
    (vl-vbarun "drawshape")

    Saludos
    Carlos
     
    RCRuiz, Feb 27, 2004
    #2
  3. jackie

    jackie Guest

    But my project gets loaded when acad initially starts.
     
    jackie, Feb 27, 2004
    #3
  4. jackie

    allfro Guest

    Just vbarun. If it is not loaded it will load. If it is it will just
    run. Heres how I do it in my acaddoc.lsp

    '//BEGIN CODE BLOCK

    (defun-q s::Startup ()
    (setvar "CMDECHO" 0)
    (setvar "FILEDIA" 0)
    (command "-PSETUPIN" "C:/Program Files/AutoCAD 2002/BLOCKS/C.DWG" "*")
    (command)
    (command)
    (command)
    (command "-vbarun" "C:/Program Files/AutoCAD
    2002/accadoc_draw/Startup.dvb!acadstartup.Startmydwg")
    )
    (Defun C:ZA ()
    (command "Zoom" "E" "Zoom" "0.95x")
    )
    (defun C:CB ()
    (command "-vbarun" "C:/Program Files/AutoCAD
    2002/Support/CenterMark/CenterMark.dvb!Main.Run")
    )
    (setvar "FILEDIA" 1)
    (setvar "CMDECHO" 1)

    '//END CODE BLOCK

    It will take short path args if they are in the Acad filepath but mine
    are spread out and it just makes me feel better knowing excactly which
    project from which path is being called up.
    Hope that helps...


    --
    allfro - Chaos Coder Extraordinaire

    'site index' (http://www.vbdesign.net/) | please use [ vbcode]
    \"your_code_here\" [/vbcode ] code tags | be nice | 'augi'
    (http://tinyurl.com/ytk37) |'go babelfish' (http://tinyurl.com/2j7df)
     
    allfro, Feb 27, 2004
    #4
  5. Jackie,
    This is from a post by Mark Propst on 02/02/2004

    I imagine you already know this, but just in case, do you have an acad.rx
    file in support path?
    with one of the following lines
    acadvba.arx ;(if 2002)
    ;acvba.arx ;(if 2004)

    that initializes vba before any macros run
     
    Jorge Jimenez, Feb 27, 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.