nod684 Posted August 7, 2014 Share Posted August 7, 2014 (edited) Hi all... am just wondering if there is a way to check if there is an Xref in a drawing without opening them. Check the whole folder and list which drawing has an xref. the reason? commonly we use e-transmit to bind multiple drawings, and knowing e-transmit command; if there is an unloaded / unrefference drawing it will skip the file and goes on to the next file. the log report was also deleted and no way for us to trace if there is an xref in each drawing but open them one by one. can this be done? Edited August 7, 2014 by nod684 Quote Link to comment Share on other sites More sharing options...
Dadgad Posted August 7, 2014 Share Posted August 7, 2014 I don't use the Design Center, but I suspect that there is an easy way to do it, and that is where I would start if I wanted to do this. Quote Link to comment Share on other sites More sharing options...
rkent Posted August 7, 2014 Share Posted August 7, 2014 Use Design Center, Search, upper left pick Xref for look for, continue from there. Quote Link to comment Share on other sites More sharing options...
Dadgad Posted August 7, 2014 Share Posted August 7, 2014 Use Design Center, Search, upper left pick Xref for look for, continue from there. Thanks rkent for filling in the gaps, I knew that was where to start from your previous post where you described it, and I tried it after reading your post and was pretty impressed, a great resource for sure. Quote Link to comment Share on other sites More sharing options...
nod684 Posted August 7, 2014 Author Share Posted August 7, 2014 can that process be translated into lisp? Quote Link to comment Share on other sites More sharing options...
7o7 Posted August 8, 2014 Share Posted August 8, 2014 Try this, be sure that no file in the chosen directory is open. (defun c:xct() (vl-load-com) (setq dir (vl-directory-files (setq dirname (strcat (vl-filename-directory (getfiled "Open file" (getvar "dwgprefix") "dwg" 4) ) "\\")) )) (foreach file dir (if (and (/= file ".") (/= file "..")) (progn (setq odbx (vla-GetInterfaceObject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar "AcadVer")))))) (vla-open odbx (strcat dirname file)) (setq st "" n 0) (vlax-for item (vla-get-Blocks odbx) (if (= (vla-get-IsXRef item) :vlax-true) (setq st (strcat st (vla-get-Name item) "; ") n (1+ n)) ) ) (if (/= st "") (princ (strcat "\nFile " (vla-get-Name odbx) " has " (itoa n) " Xref" (if (> n 1) "s" "") " : " st))) (vlax-release-object odbx) ) ) ) (textscr) (princ) ) Quote Link to comment Share on other sites More sharing options...
nod684 Posted August 20, 2014 Author Share Posted August 20, 2014 Sorry for the late reply... am getting this error ; error: Automation Error. Description was not provided. Quote Link to comment Share on other sites More sharing options...
7o7 Posted August 20, 2014 Share Posted August 20, 2014 Could you upload some files which have xrefs and getting error? Quote Link to comment Share on other sites More sharing options...
feargt Posted August 20, 2014 Share Posted August 20, 2014 As an alternative to the lisp. Use the reference Manager. go to windows start, look for the autodesk folder and here you will find a program called reference manager. locate the drawings that you wish to check and it will list all items referenced in the drawings. if you sort by type, you will see what, if any, xrefs are in which drawings. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 20, 2014 Share Posted August 20, 2014 7o7 The error took a place because the OP may had files other than Autocad formats in the same folder , so to go around this error I would rewrite it this way . (setq dir (vl-directory-files (setq dirname (strcat (vl-filename-directory (getfiled "Open file" (getvar "dwgprefix") "dwg" 4) ) "\\")) [color=magenta]"*.dwg"[/color] [color=seagreen]1[/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.