_Synchro problem with VBA and acaddoc.lsp

Discussion in 'AutoCAD' started by smd, Feb 20, 2004.

  1. smd

    smd Guest

    I've written a VBA-macro which is started by opening any dwg, therefore I activate the macro with a (COMMAND "VBARUN' "MyMacro") syntax which can be found in my acaddoc.lsp, but... there's seems to be a synchro-problem, The VBA-macro is trying to get some info (e.g. plotstyles in the dwg) BEFORE this info is available, it's seems the required info is not yet there and ACAD is giving an not escpapeable error. My macro is using Thisdrawing.xxx statements, maybe that's what I'm doing wrong ? ... Thanks for any tips ... SMD
     
    smd, Feb 20, 2004
    #1
  2. Just an untried suggestion but you could try using the vl-vbarun function
    instead. Add something like this to acaddoc.lsp.

    (defun-q MYSTARTUP ()(vl-vbarun "MyMacro")) ; Specify Path if necessary(setq
    S::STARTUP (append S::STARTUP MYSTARTUP))
    Best regards,

    Dale


    activate the macro with a (COMMAND "VBARUN' "MyMacro") syntax which can be
    found in my acaddoc.lsp, but... there's seems to be a synchro-problem, The
    VBA-macro is trying to get some info (e.g. plotstyles in the dwg) BEFORE
    this info is available, it's seems the required info is not yet there and
    ACAD is giving an not escpapeable error. My macro is using Thisdrawing.xxx
    statements, maybe that's what I'm doing wrong ? ... Thanks for any tips ...
    SMD
     
    Dale Levesque, Feb 20, 2004
    #2
  3. Sorry, word wrap.

    Just an untried suggestion but you could try using the vl-vbarun function
    instead. Add something like this to acaddoc.lsp.

    (defun-q MYSTARTUP ()(vl-vbarun "MyMacro")) ; Specify Path if necessary

    (setq S::STARTUP (append S::STARTUP MYSTARTUP))


    Best regards,

    Dale
     
    Dale Levesque, Feb 20, 2004
    #3
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.