Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

purge doesnt help. i dont see what blocks have to do with it all except that they are causing a problem

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...