Author Topic: Automatically Update XREF  (Read 5357 times)

0 Members and 1 Guest are viewing this topic.

RGUS

  • Newt
  • Posts: 106
Automatically Update XREF
« on: November 17, 2012, 03:37:56 PM »
Hi...
I was just wondering...
When I have an XREF drawing and a drawing containing that XREF opened ... if I were to change something on the XREF drawing, save it, and then change to the drawing containing the XREF, also opened, AutoCAD pops up a notification that I need to reload the XREF.

This is annoying, "of course I want to reload the XREF" I just changed it didn't I.
Is there a way to bypass this notification and automatically reload the XREF when I switch drawings.
AutoCAD must store somewhere, somehow that the XREF has changed, otherwise the notification bubble wouldn't pop up.
Why can't they have provided an option to update automatically.

Thanks
Deane


BlackBox

  • King Gator
  • Posts: 3770
Re: Automatically Update XREF
« Reply #1 on: November 17, 2012, 09:53:29 PM »
If a built-in solution exists, then I am unaware of it.

I agree that a system variable should exist (XrefReloadAuto?), which hooks the existing FileSystemWatcher that is instantiated for the parent directory of each external reference that exists within the Document Collection.

While much is unknown (or at least undocumented) about the code-behind that supports the external reference mechanism(s), as I understand it, they (Autodesk) need only hook the DocumentaBecameCurrent event in order to evaluate the value of the pseudo XrefReloadAuto system variable (thus effectively reloading external references automagically).

In order to do this via LISP, you'd need to implement your own DocManager reactor, in order to monitor the same DocumentBecameCurrent event, but rather than employ a FileSystemWatcher at drawing open you would instead possibly store each external reference's vl-File-Systime in a grouped pair (with the reference).

When the DocumentBecameCurrent event fires, test for updates to the stored list of external references and associated systimes. Also be sure to implement the necessary Command, or AcDb reactors in order to update your list of grouped pairs as needed.

My $0.02
« Last Edit: November 18, 2012, 08:33:01 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

RGUS

  • Newt
  • Posts: 106
Re: Automatically Update XREF
« Reply #2 on: November 17, 2012, 11:15:20 PM »
LOL Renderman... so why aren't you working for AutoDESK... if I understood what you said, then I wouldn't suggest it.
But... reading it over and over again... it seems to rely on some sort of internal reactor mechanism.
Bugger... and I thought it would be easy.
Thanks mate.

BlackBox

  • King Gator
  • Posts: 3770
Re: Automatically Update XREF
« Reply #3 on: November 18, 2012, 01:14:51 AM »
LOL Renderman... so why aren't you working for AutoDESK... if I understood what you said, then I wouldn't suggest it.
But... reading it over and over again... it seems to rely on some sort of internal reactor mechanism.
Bugger... and I thought it would be easy.
Thanks mate.

That is kind of you to say; not sure what the future has in store.  :-)

Sorry if my previous post was not clear... This can be done (even with LISP, with some help from a  .NET LispFunction), but there are trade offs.

Most notably the unexpected lag time when the application becomes unresponsive due to reloading one or more external references.

Another issue that could easily present itself, especially in a muti-user environment, is for you to be laying out some line work based upon the external reference, and another user modifies said reference drawing, and unexpectedly the line work you needed to reference goes missing.

"How we think determines what we do, and what we do determines what we get."

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Automatically Update XREF
« Reply #4 on: November 18, 2012, 03:05:43 AM »
I swear I've seen this exact same question before ... just cannot find the thread.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Automatically Update XREF
« Reply #5 on: November 18, 2012, 11:32:07 AM »
Did you look here?
http://goo.gl/gMpR9
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Automatically Update XREF
« Reply #6 on: November 18, 2012, 12:40:13 PM »
Did you look here?
http://goo.gl/gMpR9

Yep, and used other keywords too. Even omitting the site specific modifier to see if it was on another forum. Still can't find it. Must've been named something I cannot think of just now.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

BlackBox

  • King Gator
  • Posts: 3770
Re: Automatically Update XREF
« Reply #7 on: November 18, 2012, 01:25:41 PM »
In any event, just wanted to say "thanks, CAB!" For sharing that link - being relatively new to .NET I usually focus on self-teaching. Your suggestion pointed me toward one of the library threads which I could stand to learn a lot from.

Cheers! :beer:
"How we think determines what we do, and what we do determines what we get."

RGUS

  • Newt
  • Posts: 106
Re: Automatically Update XREF
« Reply #8 on: November 18, 2012, 05:39:37 PM »
Thanks guys... looks like it ain't gonna be possible from my humble understand of coding... looking forward to the new release of the ACAD wishlist.