chelsea1307 Posted March 13, 2009 Posted March 13, 2009 lpsfiert found this for me but i cannot get it to work, any one who knows something about lsp want to explain what I need to do to get it to work (other then load it and type in the x2o part i can use lsp but this one just isnt working for me.) it keeps looking for blocks that i dont have but i dont know what blocks i need to create for it to work or what they need to be of. this would help me alot if it actually worked. http://discussion.autodesk.com/forum...46212 Quote
Lee Mac Posted March 13, 2009 Posted March 13, 2009 I haven't properly looked at the LISP as yet - but it sounds like its finding blocks in the file that aren't in the drawing I would suggest purging the drawing, then runnign the LISP to see if it makes any difference. Quote
chelsea1307 Posted March 13, 2009 Author Posted March 13, 2009 purge doesnt help. i dont see what blocks have to do with it all except that they are causing a problem Quote
Lee Mac Posted March 14, 2009 Posted March 14, 2009 Just looked at the LISP - are you supplying it with the necessary arguments needed? (defun c:x2o () (xreftooverlay nil)) (defun xreftooverlay ([b]namelst[/b] / uncommonblock uncommonblockclip a curlaystate cpath delme fdelme) ; xref to overlay (if (= (type namelst) 'STR) (setq namelst (list namelst))) (if (not namelst) (setq namelst ([b]getxreflst[/b]))) (setq count 0) (while (or (findfile (strcat "ub" (itoa count) ".dwg")) (tblsearch "BLOCK" "ub" (itoa count))) (setq count (1+ count))) (setq uncommonblock (strcat "ub" (itoa count) ".dwg")) (command "point" "0,0" "wblock" (setq fdelme (strcat (getvar "dwgprefix") uncommonblock)) "" "0,0" (entlast) "") (setq uncommonblockclip (substr uncommonblock 1 (- (strlen uncommonblock) 4))) (command "undo" "begin") (command "._-layer" "a" "save" "BEI" "" "" "") (COMMAND ".-LAYER" "UNLOCK" "*" "") (foreach a namelst (setq cpath (xrefpath a)) (command "xref" "overlay" (findfile uncommonblock) "0,0" "" "" "") (setq delme (ssget "x" (list (cons 2 uncommonblockclip)))) (command "xref" "path" uncommonblockclip cpath) (redefxrefs a uncommonblockclip) (command "xref" "detach" a) (command "rename" "block" uncommonblockclip a) (if delme (command "erase" delme "")) ) ; foreach (command "._-layer" "a" "restore" "BEI" "" "" "") (command "._-layer" "a" "delete" "BEI" "" "" "") (command "._-xref" "d" "ub*") (command "undo" "e") (vl-file-delete (strcat fdelme)) (princ) ) ; xreftooverlay You will need to make sure that you have the subroutine "getxreflst" running as well. Quote
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.