wildcards in script files

Discussion in 'AutoCAD' started by Jmarchese, Mar 3, 2004.

  1. Jmarchese

    Jmarchese Guest

    is it possible to use wildcards in script files? I want to write a script file that creates a base file from a floor plan, where the floor plan is XYZAFP01. The base file will be XYZABP01. I would wblock out the floor plan to a new file. Any help would be appreciated. Thanks. Jim
     
    Jmarchese, Mar 3, 2004
    #1
  2. Jmarchese

    ECCAD Guest

    In script, you could do:
    (setq oname (getvar "DWGNAME"))
    (setq nname (strcat (substr oname 1 4) "B" (substr oname 6 3)))
    (command "_saveas" nname "n")

    Bob
     
    ECCAD, Mar 3, 2004
    #2
  3. Jmarchese

    Jmarchese Guest

    Bob,
    thanks for the help. I'm on my way to getting the desired results. Here's a few more things I'm trying to do:

    I'd like to wblock the base plan out of the floor plan, so I switched the "_saveas" to "-wblock". It's beginning to work, but I was wondering if it was possible to have the script pause, have the user choose to overwrite a file if it already exists, then continue the script. Also, is it possible to have the user specify a new location for the block using a path such as X:\projnumber\xref? Again, thanks in advance for your help!

    Jim
     
    Jmarchese, Mar 3, 2004
    #3
  4. Jmarchese

    ECCAD Guest

    Jim,
    Direct answer. No, not in a script. You can 'pause' easily, but prompting for Y or N, based on file existance is a whole lot tricker in a script. Also, within the 'script' world, to pop up a dialog / browse, then save to some folder is not where you want to go. You would benefit from a 'Lisp' program to do all the operations (suscessfully). A lisp can throw up a dialog for where to save the file, and check for file exist, etc.
    Therefore, the script becomes much easier. All it has to do is to 'call' the Lisp, and it gets done.
    (load "fix_my_problem.lsp") - in the script is all you need, along with the lisp program.

    Bob
     
    ECCAD, Mar 3, 2004
    #4
  5. Jmarchese

    ECCAD Guest

    Oops,
    I never said I could spel.
    Bob
     
    ECCAD, Mar 3, 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.