wblockm setting

Discussion in 'AutoCAD' started by Xolo, Oct 5, 2004.

  1. Xolo

    Xolo Guest

    Hey everyone,

    I recently downloaded WBLOCKM.LSP from www.dotsoft.com's free download
    section. What I want this LISP to do for me is to have a different default
    folder that it will wblock all blocks to (it's set to the same folder as the
    open drawing file is currently in I believe).

    Can someone take a look at the code and tell me which item to change?

    I would like the default target directory to be;

    C:\MFL Block Library\Temp

    Thanks in advance for all of your help,

    Xolo



    ; ----------------------------------------------------------------------
    ; (Wblocks all local block definitions to target path)
    ; Copyright (C) 2000 DotSoft, All Rights Reserved
    ; Website: http://www.dotsoft.com
    ; ----------------------------------------------------------------------
    ; DISCLAIMER: DotSoft Disclaims any and all liability for any damages
    ; arising out of the use or operation, or inability to use the software.
    ; FURTHERMORE, User agrees to hold DotSoft harmless from such claims.
    ; DotSoft makes no warranty, either expressed or implied, as to the
    ; fitness of this product for a particular purpose. All materials are
    ; to be considered 'as-is', and use of this software should be
    ; considered as AT YOUR OWN RISK.
    ; ----------------------------------------------------------------------

    (defun c:wblockm ()
    (setq cmdecho (getvar "CMDECHO"))
    (setvar "CMDECHO" 0)
    ;
    (if (not dos_getdir)
    (setq path (getstring "\nDS> Target Folder: " T))
    (setq path (dos_getdir "Target Folder" (getvar "DWGPREFIX")))
    )
    (if (/= path nil)
    (progn
    (if (= (substr path (strlen path) 1) "\\")
    (setq path (substr path 1 (1- (strlen path))))
    )
    (princ "\nDS> Building List of Blocks ... ")
    (setq lst nil)
    (setq itm (tblnext "BLOCK" T))
    (while (/= itm nil)
    (setq nam (cdr (assoc 2 itm)))
    (setq pass T)
    (if (/= (cdr (assoc 1 itm)) nil)
    (setq pass nil)
    (progn
    (setq ctr 1)
    (repeat (strlen nam)
    (setq chk (substr nam ctr 1))
    (if (or (= chk "*")(= chk "|"))
    (setq pass nil)
    )
    (setq ctr (1+ ctr))
    )
    )
    )
    (if (= pass T)
    (setq lst (cons nam lst))
    )
    (setq itm (tblnext "BLOCK"))
    )
    (setq lst (acad_strlsort lst))
    (princ "Done.")
    ;
    (foreach blk lst
    (setq fn (strcat path (chr 92) blk))
    (if (findfile (strcat fn ".dwg"))
    (command "_.WBLOCK" fn "_Y" blk)
    (command "_.WBLOCK" fn blk)
    )
    )
    )
    )
    ;
    (setvar "CMDECHO" cmdecho)
    (princ)
    )
     
    Xolo, Oct 5, 2004
    #1
  2. Xolo

    Jeff Mishler Guest

    Change these lines:
    (if (not dos_getdir)
    (setq path (getstring "\nDS> Target Folder: " T))
    (setq path (dos_getdir "Target Folder" (getvar "DWGPREFIX")))
    )

    To this:
    (setq path "C:\\MFL Block Library\\Temp")
     
    Jeff Mishler, Oct 5, 2004
    #2
  3. Xolo

    Xolo Guest

    Jeff,

    I still want it able to be changed under special circumstances, but the
    default folder to be as shown. So wouldn't I just alter this line;

    (setq path (dos_getdir "Target Folder" (getvar "DWGPREFIX")))

    to something like this;

    (setq path (dos_getdir "C:\\MFL Block Library\\Temp")))

    I think that this should do what I want but I would like an experienced
    opinion on this before trying the change.

    Xolo

    Change these lines:
    (if (not dos_getdir)
    (setq path (getstring "\nDS> Target Folder: " T))
    (setq path (dos_getdir "Target Folder" (getvar "DWGPREFIX")))
    )

    To this:
    (setq path "C:\\MFL Block Library\\Temp")
     
    Xolo, Oct 5, 2004
    #3
  4. Xolo

    Jeff Mishler Guest

    OK, I don't have DOSLIB to verify this, but based on the existing code I'd
    say that this should work:
    (if (not dos_getdir)
    (setq path (getstring "\nDS> Target Folder: " T))
    (setq path (dos_getdir "Target Folder" "C:\\MFL Block Library\\Temp"))
    )
     
    Jeff Mishler, Oct 5, 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.