Reload (Update) all modified XREF's in all open Tabs

Reload (Update) all modified XREF's in all open Tabs

4co2op0
Contributor Contributor
2,216 Views
3 Replies
Message 1 of 4

Reload (Update) all modified XREF's in all open Tabs

4co2op0
Contributor
Contributor

Main goal I am hoping to achieve:

A command that will RELOAD (or rather: UPDATE) the modified XREF's in ALL open drawing tabs.

 

To Clarify the situation:

I have 10+ drawings open. All open drawing tabs are referencing the same XREF's. Another team member is working on those XREF's and saves one or more of them which I now need to update in all of my open drawing tabs before I publish the entire set. 

 

Currently I can do 1 of 2 things.

1) Go into each tab one by one, and reload the XREF's.

2) Close all drawings and Re-Open them which will load the latest saved references.

 

I would prefer to type in a command that will just reload all the XREF's in all drawing tabs, similar to the "SAVEALL" command which saves all open drawing tabs without having to switch between each tab. I would NOT like it to RELOAD any XREF's that have been UNLOADED in the drawings, rather an update of the currently loaded XREf's in each tab.

 

From what I have read, a LISP routine would not work because LISP routines are active drawing tab (focused) specific. Perhaps a .NET program or something else would achieve this goal?

 

I know that something should be possible since the SAVEALL command is NOT an active drawing tab specific command, but I have no clue how to go about achieving this goal (LISP's are about the extent of my knowledge in these types of situations, and even that is very limited for me).

 

Any help is greatly appreciated.

 

DISCLAIMER: I have read through countless forums and discussions looking for a solution before posting this, so I know it may not be possible, but hoped some of the clarifications explained here could help get us to the ultimate goal. This would save a lot of people a lot of time and IMO should be a native AutoCAD command (Hopefully one day... fingers crossed)

 

Thank you.

 

0 Likes
2,217 Views
3 Replies
Replies (3)
Message 2 of 4

brian.strandberg
Advisor
Advisor

I understand this is what you are trying to do, I'm not sure why it is a good idea.  To do this on 10+ drawings it is going to be doing alot of processing, and you can only see one drawing at a time, so the computer is going to sleep for a while as it iterates through all open drawings.

 

It would probably be just as fast to close all drawings and then re-open them (depending on the drawing).  

 

I have been working on learning .net programming with the book below, but been very busy to work on it.

 

https://www.amazon.com/Start-Programming-AutoCAD-Anton-Huizinga-ebook/dp/B0B86HJDYK/ref=sr_1_1?keywo...

 

Check out my Civil 3d blog at: http://c3dk.com/
Favorite Posts: Use Dynamo For Surface Analysis: https://youtu.be/eJNdX6guMP8
Fast Track your site grading with the new Corridor Workflow: https://youtu.be/Gg7u9-LgIL0
Message 3 of 4

4co2op0
Contributor
Contributor

I understand that the program could be heavy on the backend processing but it is quicker to switch between each drawing and reload all xrefs than it is to close and re-open all 10+ sheets since the opening process seems to take a while as well.

 

I would assume that the heavy processing would be even faster (similar to the saveall command saves me a ton of time when the team needs to see the most current changes.)

 

If it is soo heavy that it crashed the system then it would not be helpful. Otherwise it would be extremely beneficial for our engineering team (especially when needing to update all open tabs so that I can get a fresh publish out, without the need to see more than one drawing at a time, but also when a global change was made that I know will have to be shown on all tabs as I switch between them to update info as needed. This happens daily for everyone on our team)

 

I'm not very savvy on the programming side of things but will definitely give the link you shared a look and see if I can figure out a way to accomplish what I need. (I'm always trying to shave minutes off of common procedures and this is one that has been a common discussion for us)

0 Likes
Message 4 of 4

4co2op0
Contributor
Contributor

Below is the AutoCAD provided LISP for the "SAVEALL" command I am referring to. This .LSP saves all open drawings. I have to assume a similar LISP would work for reloading all Loaded XREF's in all Open Drawings. I am just not skilled enough to get it to work.

 


;;
;; save all open drawings
;;
(defun C:SAVEALL (/ dwg saveDwg)
;; save drawing
(defun saveDwg (dwg / titled writeable name)
(vl-load-com)
(setq titled (= 1 (vlax-variant-value (vla-getvariable dwg "DWGTITLED")))
writeable (= 1 (vlax-variant-value (vla-getvariable dwg "WRITESTAT")))
name (if titled
(vlax-get dwg "fullname")
(vlax-variant-value (vla-getvariable dwg "DWGNAME")) )
)
(cond
;; REFEDIT active ??
((/= "" (vlax-variant-value (vla-getvariable dwg "REFEDITNAME")))
(acet-ui-message
(acet-str-format "%1\nCannot Save while REFEDIT active." name)
"AutoCAD - SAVEALL"
Acet:ICONSTOP )
)
;; simple save if titled and writeable
((and titled writeable)
(vla-save dwg)
)
;; otherwise ask for name first
(T
(if (setq name (ACET-FILE-WRITEDIALOG "%1\nCannot Save while REFEDIT active." name "dwg" "Acet:SaveAll" 1665))
(vla-saveas dwg (vlax-make-variant name)) )
)
)
)

;; quietly
(vl-load-com)
(acet-error-init '(("CMDECHO" 0)))

;; for each drawing
(vlax-for dwg (vla-get-documents (vlax-get-acad-object))
;; save if modified
(if (/= 0 (vlax-variant-value (vla-getvariable dwg "DBMOD")))
(saveDwg dwg) )
)

(acet-error-restore)
(princ)
)


(princ)

0 Likes