MR MAN Posted August 20, 2008 Share Posted August 20, 2008 Is There Any lisp Detach Unreferenced Xref Files? Quote Link to comment Share on other sites More sharing options...
JeepMaster Posted August 21, 2008 Share Posted August 21, 2008 Yes, I have one, but it's at work. I'll post later. Quote Link to comment Share on other sites More sharing options...
borgunit Posted August 21, 2008 Share Posted August 21, 2008 http://forums.augi.com/showthread.php?t=82705 Quote Link to comment Share on other sites More sharing options...
JeepMaster Posted August 21, 2008 Share Posted August 21, 2008 Actually, my code does "Detach,Audit,bind,purge all". If you only want a code to detach unreferenced xrefs, removing audit and purge all is simple, but I don't know if removing the bind command is possible or not. Unless someone can modify the lisp so it will only bind "those unreferenced xrefs". That was the whole trick on this lisp, to repath the unreferenced xrefs to a blank drawing and bind the blank drawings. **For this lisp to work, you MUST put a blank drawing named "dummy.dwg" in your search path.** (defun C:SENT ( / ) (defun *error*(msg) (setvar "modemacro" ".") (setvar "bindtype" oldBnType) (setvar "cmdecho" 1) (princ "\n...Audit/Bind/PurgeAll terminated!!! ") (princ) ); end of *error* (setvar "modemacro" "Audit/Bind/PurgeAll processing......please wait......") (setvar "cmdecho" 0) (prompt "\n--- Audit/Bind/PurgeAll......please wait---") (prompt "\nAuditing...")(terpri) (command "_audit" "y") (bind_xrefs) (prompt "\nPurging #1")(terpri) (command "-purge" "a" "*" "N") (prompt "\nPurging #2")(terpri) (command "-purge" "a" "*" "N") (prompt "\nPurging #3")(terpri) (command "-purge" "a" "*" "N") (prompt "\n--- Audit, Bind, PurgeAll completed! ---") (setvar "modemacro" ".") (setvar "cmdecho" 1) (princ) ); end of c:sent (defun bind_xrefs ( / CMD) (setq oldBnType(getvar "bindtype")) (setq CMD (getvar "CMDECHO")) (setvar "CMDECHO" 0) (setvar "bindtype" 0) (setq XLIST (xref-status)) (if XLIST (progn (prompt "\nBinding all Xrefs...") (foreach n XLIST (rem-xref n)) (command "-xref" "b" "*" ) (prompt "...done")(terpri) ) ) (setvar "CMDECHO" CMD) (setvar "bindtype" oldBnType) (princ) ) (defun rem-xref ( XL / XNAME XSTATUS ) (setq XNAME (nth 0 XL)) (setq XSTATUS (nth 2 XL)) (if (= XSTATUS "UNLOADED") (rem_unload) ) (if (= XSTATUS "UNRESOLVED") (rem_unload) ) ) (defun xref-status ( / d n f r) (while (setq d (tblnext "block" (null d))) (cond ( (eq 4 (logand 4 (cdr (assoc 70 d)))) (setq d (entget (tblobjname "block" (cdr (assoc 2 d)))) n (cdr (assoc 2 d)) p (cdr (assoc 3 d)) f (cdr (assoc 70 d)) ) (setq r (cons (list n p (cond ( (eq 32 (logand 32 f)) "LOADED") ( (assoc 71 d) "UNLOADED") ( t "UNRESOLVED") ) ) r ) ) ) ) ) (reverse r) ) (defun rem_unload ( / ) (setq DFILE (findfile "dummy.dwg")) (if (not DFILE) (prompt "\nCannot find dummy_xref drawing ") (progn (command "-xref" "p" XNAME DFILE) (command "-xref" "r" XNAME) ) ) ) Quote Link to comment Share on other sites More sharing options...
j3m Posted December 15, 2008 Share Posted December 15, 2008 Your lisp code is really good. How can I a loop to be able to use your code for an entire folder of drawings ( approximately 20-30 drawings). E.q. : Select the folder and bind all the drawings automaticaly Thanks for your answer Quote Link to comment Share on other sites More sharing options...
JeepMaster Posted December 15, 2008 Share Posted December 15, 2008 How can I a loop to be able to use your code for an entire folder of drawings ( approximately 20-30 drawings). You can use use ScriptPro (I prefer SuperScript better) and run the SENT command to all the dwgs. That's what I do when I need to bind a set of dwgs for clients. Quote Link to comment Share on other sites More sharing options...
j3m Posted December 16, 2008 Share Posted December 16, 2008 You can use use ScriptPro (I prefer SuperScript better) and run the SENT command to all the dwgs. That's what I do when I need to bind a set of dwgs for clients. Thanks for your answer JeepMaster, unfortunately I can't install a software on my computer at work as I am not administrator. Thanks j3m Quote Link to comment Share on other sites More sharing options...
LCE Posted December 16, 2008 Share Posted December 16, 2008 Look at using a .bat file with a .scr file, in the script just run the lisp. I have posted an example on here before, run a search and see if you can find it, in the mean time I will check my hard drives and see if I can find my templates. Quote Link to comment Share on other sites More sharing options...
JeepMaster Posted December 16, 2008 Share Posted December 16, 2008 Thanks for your answer JeepMaster, unfortunately I can't install a software on my computer at work as I am not administrator.j3m You might already have scriptpro on your machine as it comes with AutoCAD if you have it checked during install. If not, you might still be able to download it from Autodesk and install, depending on what rights you have. I'm not an admin at work, but can still install scriptpro. Another option is getting SuperScript, it's a self contained exe program. Quote Link to comment Share on other sites More sharing options...
ABUSAIF Posted January 29, 2013 Share Posted January 29, 2013 Graet lisp.. Thank you.. Quote Link to comment Share on other sites More sharing options...
ABUSAIF Posted January 29, 2013 Share Posted January 29, 2013 Hello JeepMaster, is there a way to modify the list to only BIND the unreferenced Xrefs, if not, how about not binding at all, the I have the option to manually detach the xref with the dummy drawing. Thanks Quote Link to comment Share on other sites More sharing options...
nonong1191 Posted July 23, 2015 Share Posted July 23, 2015 Hello JeepMaster, is there a way to modify the list to only BIND the unreferenced Xrefs, if not, how about not binding at all, the I have the option to manually detach the xref with the dummy drawing. Thanks I modified JeepMaster's code so that the bind of all dwgs is commented out (foreach n XLIST (rem-xref n)) ; (command "-xref" "b" "*" ) (prompt "...done")(terpri) and the bind is done as a part of the individual xref work. (defun rem_unload ( / ) (setq DFILE (findfile "dummy.dwg")) (if (not DFILE) (prompt "\nCannot find dummy_xref drawing ") (progn (command "-xref" "p" XNAME DFILE) (command "-xref" "r" XNAME) [color=red](command "-xref" "b" XNAME)[/color] ) ) ) ▼ ▲▼ ▲ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.