wait for file creation

Discussion in 'AutoCAD' started by spencer1971, Aug 23, 2004.

  1. spencer1971

    spencer1971 Guest

    I am trying to get a lisp routine to pause until a pdf is created before renaming it as part of a plotting routine.

    Im probably miles out but any help would be appriciated.
    end portion of routine listed below.

    (setq testfile (dos_filep "c:\\My Documents\\plotfiles\\tempplot.pdf"))
    (while (= "nil" testfile)
    (command "delay" 2000)
    (setq dop (dos_filep "c:\\my documents\\plotfiles\\tempplot.pdf"))
    )
    (dos_delete pdfnewname)
    (dos_rename pfdoldname pdfnewname)
    (setvar "tilemode" oldtile)
    (princ)
    )

    Thanks

    Spence
     
    spencer1971, Aug 23, 2004
    #1
  2. spencer1971

    spencer1971 Guest

    sorry that should be

    (setq testfile (dos_filep "c:\\My Documents\\plotfiles\\tempplot.pdf"))
    (while (= "nil" testfile)
    (command "delay" 2000)
    (setq testfile (dos_filep "c:\\my documents\\plotfiles\\tempplot.pdf"))
    )
    (dos_delete pdfnewname)
    (dos_rename pfdoldname pdfnewname)
    (setvar "tilemode" oldtile)
    (princ)
    )
     
    spencer1971, Aug 23, 2004
    #2
  3. spencer1971

    BillZ Guest

    Couldn't you just name the file with the correct name when you plot it?
    Seems to me like it would save some time and code.


    Bill
     
    BillZ, Aug 23, 2004
    #3
  4. spencer1971

    spencer1971 Guest

    Im sorry ive mislead you, The PDF creators available on freeware are very limited in the filenaming options allowed, This is part of a routine that extracts attributes from a title block and names the file from there, I have tried to find a way to incorperate this into the pdf creator but cant, Its not a major problem, I have got the program working by simply putting a delay in but this seems a bit shabby.
     
    spencer1971, Aug 24, 2004
    #4
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.