Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help. Unsolved AutoCad Xref Problem 1

Status
Not open for further replies.

Guest
Hello,

Please help. I have an AutoCad drawing, which has a lot of Xref (external reference - collecting drawings from another location/folder in my computer and then posting them into a single AutoCad drawing). Recently, I renamed some Xref files and moved them into a different folder/location.

When I reopen my AutoCad drawing, some of my drawings cannot be displayed because some Xref are missing or not loaded (due to renaming and moving them into a different folder/location, which Autocad don't know how to locate them)
So currently i start fixing the Xref path by browsing each file to the correct name & path of the new location.

For a lot of Xrefs, this is very painfull. =) I am just wondering if there is a VBA code, which can help me fix this Xref issue. My first thought is to list all Old Xrefs (drawing name & its location) and New Xrefs in 1 folder, plug them into a VBA code, and run the VBA code in the AutoCad. Therefore, the program can match/compare the old and new Xref name & its location and automatically repath the Xref for me. Please let me know if this can be done. This really helps. Thank you in advance for your help.


Yudha
 
Replies continue below

Recommended for you

My suggestion would be don't move xref's or rename them once a project is started. This only cause's more work and a loss of money in the end. This stress' the fact that
Cadd Standards should be created/obtained including file directory structure and naming conventions up front before a project is started. Granted you won't be able to forsee some issues until you get into them but it does help.
And then any issues that come up, you can add into the plan.

I am sure you could get a program to work but you would need to know old name, old location, new name, new locations etc... not my kind of thing.
 
Your VBA idea is very feasible. It can be done.
Variations from your idea are possible: like exporting XREF names to Excel, writing the replacements in the next column, reimporting etc.

See my VBA macro that edits other texts in the drawing via exporting to Excel and importing translations back. Gives you an idea of the possibilities.

 
Hello, Thanks for the input. However, I am still not sure how this can be done. Can you help me through? Thank you again
 
Would be a pleasure if you do the starting:
From Autocad, ALT+F11
This opens the VBA editor.
Menu-Help- Search -
XREF
Object models
Example

Step 1 - Read all Xrefs in the currently open drawing and write to a txt file (full path and file name)
 
My suggestion is to attach any future xrefs as overlays with the file path box checked to save the path. This allows you to attach as many xrefs as you want from as many differant locations as you want....and AutoCad finds your drawing on it's own. We have started overlaying our attachments and have been verry happy with the results....otherwise I guess you can always bind your drawing using bind not insert.

good luck!
 
Try looking on Cadalog.com and searching for files related to "xref". I recall seeing a routine on there that does what you seem to need. I hope all goes well for you, as I have also had to go through this with saved paths coming into play after moving a local drawing to the server for backup.

-Eric Foulds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor