Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Batch Reload specified XRefs

michaelcLTMZM
Explorer

Batch Reload specified XRefs

michaelcLTMZM
Explorer
Explorer

I recently used Reference Manager to update xref paths for signature files on sheets (we recently switched servers). But I found after doing so that the Ref Manager unloads the xrefs so I want to use lisp to try to batch reload all dwgs in the specified folder and only the specified xref file names (I don't want to reload all xrefs). I have very little experience with writting lisp code.

0 Likes
Reply
Accepted solutions (2)
818 Views
9 Replies
Replies (9)

john.uhden
Mentor
Mentor

@michaelcLTMZM ,

It strikes me that you could use a dialog box to multiply select the xrefs to reload from a list_box, and then hit a "Reload" button.

Yes, it requires a little AutoLisp programming but I am occupied by my daughter and her family down from Maine for several days to celebrate my wife's birthday.  But there are plenty of brainy lispers in this forum to help you out.

John F. Uhden

0 Likes

michaelcLTMZM
Explorer
Explorer

Yes, a GUI interface would be what I would be looking for (to make it simple for everyone in the office to use), I have a start of the code attached for the background process but am getting an error when I try to use it, and don't know what I am doing wrong. I have never tried to code lisp. I only had any code experience with C++ in college for a semester before I switched my degree, over 8 years ago.

0 Likes

paullimapa
Mentor
Mentor
Accepted solution

You can use LeeMacs’s script writer to execute the same sequence of commands on an entire folder of dwgs

A sequence of commands to reload an xref: 

-xref _repload the-xref-name


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

john.uhden
Mentor
Mentor

@michaelcLTMZM ,

After reviewing your code it seems to me you may have taken a wrong turn, although I like your level of expertise as just a beginner.

If the xrefs were just unloaded and not detached, then you can find them in the blocks section of your drawing, complete with path, and just reload them.  You don't need to search for the file locations.  In fact, you don't need to know the file locations at all.

In fact in fact, you don't need any lisp at all.  In your list of references you can just pick one that's unloaded, right click, and reload.

 

 

 

John F. Uhden

0 Likes

Sea-Haven
Mentor
Mentor

If your xrefs are located in the same place as your dwg then re-pathing should not be necessary, as the CAD will look there also for them.

0 Likes

michaelcLTMZM
Explorer
Explorer

I have never used LeeMac's scripting tool, when I try to run the command it comes back with this error, and I can't figure out what I am doing wrong. It is probably something stupid. See attached.

0 Likes

paullimapa
Mentor
Mentor
Accepted solution

Should be -xref reload

and make sure you don’t have that dwg opened


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

michaelcLTMZM
Explorer
Explorer

I got it working!

Is there a setting for it to run in the background, so I can do something else while it runs, like the setting for plotting in the background?

 

For anyone else who is looking for a solution to the same problem here is the script.

 

_.open *file* -image reload [AttachedImageName] _.save _Y _Y _.close

_.open *file* -xref reload [xrefName] _.save _Y _Y _.close

 

*you need the second _Y for it asking if you would like to overwrite itself.

0 Likes

paullimapa
Mentor
Mentor

No setting to run this in the background for this method.

But there's another method with AcCoreconsole which does not even open AutoCAD's graphic window.

But I'm not sure you can open and work on AutoCAD while AcCoreconsole is running.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes