launch external app - wait for it to complete

Discussion in 'AutoCAD' started by jeffds, May 17, 2004.

  1. jeffds

    jeffds Guest

    Hello
    I need to launch an external application which accepts user data and then creates a text file.
    My AutoLISP routine then reads that file and inserts a block with attributes read from the file.
    I can launch it using startapp but the problem is that the Lisp routine carries on excuting without waiting for the external app to close.
    ie - it is not pausing at the startapp line. It launches tha external application and then jumps staright to the rest of the code - trying to read the file and insert the block before the user has entered the data via the external app.
    Is there a way to make the code pause at or just after the startapp entry until the external application is closed down.
    thanks for any help..
     
    jeffds, May 17, 2004
    #1
  2. DOSLIB at www.mcneel.com , dos_exewait does job.

    Regards,
    Seva Minkovich,
    Etecad ltd.
    , www.etecad.com



    carries on excuting without waiting for the external app to close.
    application and then jumps staright to the rest of the code - trying to read
    the file and insert the block before the user has entered the data via the
    external app.
    until the external application is closed down.
     
    Seva Minkovich, May 17, 2004
    #2
  3. jeffds

    ECCAD Guest

    I use a VB program to do the same type of operation.
    Basically, in Lisp, I wait for a 'done.dat' file to be present.
    (E.g)
    Delete old done.dat file if found.
    Run the App
    While (not (findfile "done.dat"))
    ); wait for file to be there
    ;
     
    ECCAD, May 17, 2004
    #3
  4. jeffds

    Remyga Guest

    Make dll with VB, then lounch it with command:


    (setq Test (vlax-create-object "Somedll.clsClassinDll"))
    (setq answer (vlax-invoke-method Test 'SomeMethod))

    thats all.
     
    Remyga, May 17, 2004
    #4
  5. jeffds

    ECCAD Guest

    The problem is not launching the App, but waiting (in Lisp), for the App to complete..the App fires up, but the Lisp doesn't wait for the App to complete.

    Bob
     
    ECCAD, May 17, 2004
    #5
  6. jeffds

    ECCAD Guest

    Sorry,
    Missed your intent here, that will work also.
    Bob
     
    ECCAD, May 17, 2004
    #6
  7. If you have modified your Acad.pgp file to provide access to that external
    app, you can simply modify its options, e.g.:

    EDITTPAD, start /w c:\progra~1\textpa~1\TextPad, 10,File to edit: ,

    and then

    (defun C:Test (/ fileN)
    (setq fileN (getstring "\nFile to edit: "))
    (command "._EditTPad" fileN)
    (alert "I'm all done editing.")
    (princ))

    --
    R. Robert Bell


    Hello
    I need to launch an external application which accepts user data and then
    creates a text file.
    My AutoLISP routine then reads that file and inserts a block with attributes
    read from the file.
    I can launch it using startapp but the problem is that the Lisp routine
    carries on excuting without waiting for the external app to close.
    ie - it is not pausing at the startapp line. It launches tha external
    application and then jumps staright to the rest of the code - trying to read
    the file and insert the block before the user has entered the data via the
    external app.
    Is there a way to make the code pause at or just after the startapp entry
    until the external application is closed down.
    thanks for any help..
     
    R. Robert Bell, May 17, 2004
    #7
  8. jeffds

    jeffds Guest

    thank you to everyone that responded.
    I used the DOSLIB arx and that worked perfectly.
    thanks again.
     
    jeffds, May 18, 2004
    #8
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.