feargt Posted May 20, 2009 Posted May 20, 2009 Hi, I want to edit may acaddoc.lsp file so that it will find all xref and image paths with a path "B:\_Projects and redirect them so the path is "\\SERVER101\ACAD\_Projects. I thought this might be possible using the express command "redir" But it doesn't seem to work for me.... Any ideas how I should go about this? thanks Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 Why can't you repath xrefs using Reference Manager? Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 From AutoCAD Help file: "Reference Manager is a stand-alone application with its own Help system. To access it, click Start menu (Windows) > (All) Programs Autodesk > AutoCAD > Reference Manager. If you are working on a network, it may not have been installed on your computer." Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 Why can't you repath xrefs using Reference Manager? Of course I could do that........but that is not the point of what I want to do. Users are inserting xrefs to new drawings and generally insert it over the local path instead of over the server path. If someone in another department opens the drawing, the xref path will not be found. So to avoid that I want to automate that, so that autocad will do it at the start when it opens a drawing. Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 Also when users need to open drawings from older projects it would do the same. Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 I can call the command (c:redir) from within my acaddoc.lsp file but can't seem to get it to take the path names that it need to change..... Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 Does the job have to be done within acaddoc.lsp? Could it be handled by calling an external batch (.bat) command? Just thinking out loud here. Don't mind me. Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 How about this? http://discussion.autodesk.com/forums/thread.jspa?threadID=386244 Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 Does the job have to be done within acaddoc.lsp? Could it be handled by calling an external batch (.bat) command? Just thinking out loud here. Don't mind me. I'm sure there are several possible solutions out there to achieve what I want. I don't want however to have to........ run reference manager once a month...... or run a batch file every so often....... or open a drawing and have to manually change the paths....... Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 How about this? http://discussion.autodesk.com/forums/thread.jspa?threadID=386244 you may have found a winner here. will post back shortly after testing Quote
Lee Mac Posted May 20, 2009 Posted May 20, 2009 I would say pull something from the redir.lsp directly and call it to do what you want - but its a pretty Hefty LISP to breakdown... Quote
Lee Mac Posted May 20, 2009 Posted May 20, 2009 How about this? http://discussion.autodesk.com/forums/thread.jspa?threadID=386244 Looks like someone else did what I suggested Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 (if (findfile "redir.lsp") (progn (load "redir") (bns_redir_xrefs "B:\_projects" "\\server101\acad\_Projects") ) ) (prompt "\nACADDOC.LSP loaded....") First I kept getting an error because it was missing a parenthesis, fixed that, loaded it and nothing happens except for the ACADDOC.LSP loaded.......... I also tried using double backslashes but that also does nothing for me....... Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 I guess I'm not going to make it out of the doghouse on this one. I'll keep sniffing around. Sure thought that was going to be a winner though. Dang! Maybe Lee Mac will come to my rescue. I'll turn on the Mac Light. High intensity beam focuses the letters LM on low hanging dark clouds. Quote
Lee Mac Posted May 20, 2009 Posted May 20, 2009 I guess I'm not going to make it out of the doghouse on this one. I'll keep sniffing around. Sure thought that was going to be a winner though. Dang! Maybe Lee Mac will come to my rescue. I'll turn on the Mac Light. High intensity beam focuses the letters LM on low hanging dark clouds. Hahahahah... but even I am slightly stumped with this one. This routine comes from the AutoDesk geniuses themselves... pretty deep stuff. All I can think is that it doesn't like the drive being there. Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 aaaaghhhh!!!!!! I should have left work 3 hours ago. it's a holiday here tomorrow....I should have known better than to start trying to solve this at 4.55pm. Remark...... Which doghouse are you in?? Remark/Lee Mac Thank you both for your time and this. I'll have to leave it for now. If I get a chance will have a look at this from home tomorrow. Thanks again for your time and effort. As always on this site, it's much appreciated!! Quote
ReMark Posted May 20, 2009 Posted May 20, 2009 Just got the impression I had ruffled your feathers a bit. If I had it was not my intention at all. Cheers mate. Have a good holiday. Catch you on the flip side I hope. Quote
Lee Mac Posted May 20, 2009 Posted May 20, 2009 Good luck with it dude - let us know the solution if you solve it :wink: Quote
feargt Posted May 20, 2009 Author Posted May 20, 2009 http://discussion.autodesk.com/forums/thread.jspa?messageID=1190172 found this too, but will REALLY have to wait until tomorrow to look further into it.......am going home now!! For defo! cheers again Quote
ronjonp Posted May 20, 2009 Posted May 20, 2009 Give this a whirl for your xrefs...did not have time to deal with images. You may have to use the CLASSICXREF command to see instant results. They were not showing up in the new pallette xref manager until the drawing was reopened?? (defun rjp-changexrefpath (path1 path2 / newpath xrpath) (vl-load-com) (vlax-map-collection (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (function (lambda (x) (if (= (vla-get-isxref x) :vlax-true) (progn (setq xrpath (strcase (vlax-get x 'path) t)) (if (and (vl-string-search (strcase path1 t) xrpath) (setq newpath (vl-string-subst path2 path1 xrpath)) (findfile newpath) ) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath))) (princ (strcat "\n**OLD path found but was not changed!\n" xrpath)) (princ (strcat "\n" newpath)) ) ) ) ) ) ) ) (princ) ) ;;(rjp-changexrefpath "B:\\_Projects" "\\\\SERVER101\ACAD\\_Projects") 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.