Jump to content

Recommended Posts

Posted

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

  • Replies 36
  • Created
  • Last Reply

Top Posters In This Topic

  • feargt

    16

  • Lee Mac

    7

  • ReMark

    6

  • ronjonp

    4

Posted

Why can't you repath xrefs using Reference Manager?

Posted

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."

Posted
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.

Posted

Also when users need to open drawings from older projects it would do the same.

Posted

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.....

Posted

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.

Posted
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.......

Posted

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... :geek:

Posted

(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.......

Posted

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.

Posted
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. :unsure:

Posted

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!!

Posted

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.

Posted

Good luck with it dude - let us know the solution if you solve it :wink:

Posted

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")

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...