Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Reload specified XRefs

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
michaelcLTMZM
593 Views, 9 Replies

Batch Reload specified XRefs

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.

Tags (2)
9 REPLIES 9
Message 2 of 10
john.uhden
in reply to: michaelcLTMZM

@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

Message 3 of 10
michaelcLTMZM
in reply to: john.uhden

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.

Message 4 of 10
paullimapa
in reply to: michaelcLTMZM

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
Message 5 of 10
john.uhden
in reply to: michaelcLTMZM

@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

Message 6 of 10
Sea-Haven
in reply to: michaelcLTMZM

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.

Message 7 of 10
michaelcLTMZM
in reply to: paullimapa

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.

Message 8 of 10
paullimapa
in reply to: michaelcLTMZM

Should be -xref reload

and make sure you don’t have that dwg opened


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 9 of 10
michaelcLTMZM
in reply to: paullimapa

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.

Message 10 of 10
paullimapa
in reply to: michaelcLTMZM

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report