;XREFED.LSP V.2.5 10-28-05 ;By Bill DeShawn bdeshawn@prodigy.net ;This is freeware ;Permission granted to distribute ;Permission denied to modify. Inform me. I'll do it. ;Not responsibile for any damage to anybody or anything. ;If you don't get it from me, or from CADDEPOT, it isn't mine. (defun xrefederr (msg) (if c:r (c:r) redraw) (setq ent nil elist nil xrefname nil scl nil ip nil fn nil) (setq *error* olderr) (princ msg) (prompt ". Please try again.") (princ) ) (defun cmdOpen (name) (vl-load-com) (if (= 0 (getvar "SDI")) (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) name)) (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "(command \"_.OPEN\")\n" name "\n") ) ) ) (defun c:xrefed (/ ent elist xrefname ip fn acadexe) (setq olderr *error*) (setq *error* xrefederr) (setq ent (entsel "\nSelect the Xref to edit: ")) (setq elist (entget (car ent))) (setq xrefname (cdr (assoc 2 elist))) (setq ip (cdr (assoc 10 elist))) (setq fn (findfile (strcat xrefname ".dwg"))) (if (null fn)(Alert " File not found")) ; (setq acadexe (findfile "acad.exe")) ; (startapp (strcat acadexe " /nologo " fn)) ;If Autodesk VLISP is not available, remove comment from lines above and comment out line below. (cmdopen (findfile fn)); comment out this line if there is no Autodesk VLISP available. ; (alert "Press OK when finished editing the XREF.") (getpoint "\nClick in drawing with digitizer or mouse to reload xref") (command "xref" "r" xrefname) (if (and xlay (findfile "gbcsetup.lsp")) (progn (if (= xlay "F") (c:xf)) (if (= xlay "G") (c:xg)) (if (= xlay "L") (c:xl)) (if (= xlay "M") (c:xm)) (if (= xlay "U") (c:xu)) (if (= xlay "B") (c:xb)) (if (= xlay "R") (c:xr)) (if (= xlay "P") (c:xp)) (if (= xlay "S") (c:xs)) (if (= xlay "1") (c:x1)) (if (= xlay "2") (c:x2)) (if (= xlay "3") (c:x3)) (if (= xlay "4") (c:x4)) ) ) (if (and lay (findfile "gbcsetup.lsp")) (progn (if (= lay "F") (c:lsf)) (if (= lay "G") (c:lsg)) (if (= lay "L") (c:lsl)) (if (= lay "M") (c:lsm)) (if (= lay "U") (c:lsu)) (if (= lay "B") (c:lsb)) (if (= lay "R") (c:lsr)) (if (= lay "P") (c:lasp)) ) ) (if lay (princ (strcat "GBC LAYER GROUP IS: " lay))) (setq *error* olderr) (princ) ) (if (/= (getvar "xloadctl")2)(alert (strcat "NOTICE: In order for this routine to work, you must go to the Preferences Dialog box and select the Open and Save tab, and under External References; Demand Load Xrefs, select "(chr 34)"Enabled with copy"(chr 34)". After making this setting you may have to start a new drawing session in order for the new setting to take effect.")) ) (princ "\nXREFED.LSP V.2.5 10-28-05")