Author Topic: Reloading a specific xref on a bunch of draings  (Read 2247 times)

0 Members and 1 Guest are viewing this topic.

diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Reloading a specific xref on a bunch of draings
« on: March 24, 2015, 01:28:36 PM »
Once again I need your guys help.
What I am looking for is to be able to reload an unloaded reference file in a bunch of drawings located within a directory.
The code below is what I have but seems that I am missing something.
Any help will be very much appreciated it.


(defun c:reload ( )
    (LM:ODBX
        (function
            (lambda ( doc / xref name)
                ;(vlax-for lay (vla-get-layers doc)
      (vlax-for xref (vla-get- xref name)
        (if (wcmatch (strcase (vla-get-name xref)) "*|Road_Construction_City")
      (vla-put- reload xref :vlax-true)
                    )
                )
            )
        )
        nil t
    )
    (princ)                              
)
Thank you…

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Reloading a specific xref on a bunch of draings
« Reply #1 on: March 24, 2015, 01:36:00 PM »
If I recall correctly, xrefs are not available/loaded when interfacing with a drawing through ObjectDBX - you may need to use a Script to perform this task.

diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Re: Reloading a specific xref on a bunch of draings
« Reply #2 on: March 24, 2015, 01:51:04 PM »
Thank you Lee Mac,

Can you help me with that please?

Thank you...

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Reloading a specific xref on a bunch of draings
« Reply #3 on: March 24, 2015, 01:53:07 PM »
If you write the code to reload the xref in a single drawing, you can use my old Script Writer program to evaluate your xref program across several drawings.

diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Re: Reloading a specific xref on a bunch of draings
« Reply #4 on: March 24, 2015, 02:00:40 PM »
Thank you Lee Mac,
You are talking to a rock here and I am Man U fan not West Ham... :)...

How deos this scrip works? I load as a .lsp file?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Reloading a specific xref on a bunch of draings
« Reply #5 on: March 24, 2015, 03:22:12 PM »
Just a quick glance .. but this will always be false:
Code: [Select]
(wcmatch (strcase (vla-get-name xref)) "*|Road_Construction_City")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cadtag

  • Swamp Rat
  • Posts: 1152
Re: Reloading a specific xref on a bunch of draings
« Reply #6 on: March 25, 2015, 02:08:09 PM »
the question is... Why?

xref's will be reloaded anytime the drawing is opened or edited.  An plotting/publishing counts as opening.
The only thing more dangerous to the liberty of a free people than big government is big business

diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Re: Reloading a specific xref on a bunch of draings
« Reply #7 on: April 01, 2015, 04:46:39 PM »
The reason is that our with our drawing’s template, we add most of our Digital Stamps such as Issue for construction, Preliminary not for construction and such.
All of these stamps are unloaded in our template but when drawings are to be sent out, we need to show of them depend on the stage of the project, going to every drawing and reload it manually is time consuming.