HI,
I see your older post.
Did you ever find that lisp that works to un-bind files?
I have tried the lisp included earlier in this post, it seems to run, but I don't know where it's writing the files out to. Did you have luck with it.
Thanks
Actually the code in the post did not work, it gave me an error as follows:
Command: UNBIND
Loading ...; error: extra cdrs in dotted pair on input
I'm not a programmer, just a hack user, so I don't know what its telling me.
I did find the following which did work, but again no idea where it's writing the output
;;;==UNBIND.LSP=====================================================
;;; This program "unbinds" bound xreferences
;;; removing the bound items and recreating the original file
;;;==================================================================
(prompt "\nUNBIND\nLoading ...")
(defun C:UNBIND (/ BLCK BLK_NAME EXPR WBLOK)
(setq EXPR (getvar "expert"))
(setvar "EXPERT" 4)
(setvar "CMDECHO" 0)
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
;;; and then try to load it.
(cond
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
( (not (findfile "ai_utils.lsp")) ; find it
(ai_abort "SPECIAL"
(strcat "Can't locate file AI_UTILS.LSP."
"\n Check support directory.")))
( (eq "failed" (load "ai_utils" "failed")) ; load it
(ai_abort "SPECIAL" "Can't load file AI_UTILS.LSP"))
)
(command "-layer" "on" "*" "thaw" "*" "unlock" "*" "S" "0" "")
(setq blk_list (ai_table "block" 14)) ; no anonymous, Xrefs or
; Xref dependents.
(setq rep 0)
(repeat (length blk_list)
(setq BLCK_NAME (nth rep blk_list))
(progn
(if (wcmatch BLCK_NAME "*$#$*");bound block
(progn
(setq head (substr BLCK_NAME 1 (str_pos "$" BLCK_NAME))
whead (strcat head "*")
fname (substr head 1 (- (strlen head) 1))
)
(setq flist (list '(-4 . "<OR")
(cons 8 whead)
(cons 2 whead)
(cons 6 whead)
(cons 7 whead)
(cons 3 whead)
'(-4 . "OR>")
)
)
(setq xsels (ssget "X" flist))
(command "wblock" fname "" "0,0" xsels "")
(command "purge" "a" "" "n")
(command "purge" "a" "" "n")
(command "purge" "a" "" "n")
(command "purge" "a" "" "n")
);end progn
);endif
);end progn
(setq rep (+ 1 rep))
);end repeat
(setvar "EXPERT" EXPR)
(prompt "\n")
(prompt "\nWBlocking complete.")
(princ)
)
(defun STR_POS (schar sstring / )
(setq ptr (strlen sstring)
ctr 0
fnd nil)
(while (and (< ctr ptr)(not fnd))
(setq ctr (+ 1 ctr))
(setq fnd (or fnd (= (substr sstring ctr 1) schar)))
);end while
(setq ctr ctr)
)