+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Question Any lisp to reload only "loaded" xrefs

    Registered forum members do not see this ad.

    We're using ADT 2004. I wanted to know if there's an easier way to reload "loaded" xrefs. The only way that I know is open xref manager and pick all the xrefs that I want to reload and click the reload button. This is getting cumbersome as people at work are saving their xrefs every minute. I constantly have to reload the xrefs. The problem I have is there are loaded and unloaded xrefs in my dwg, so I can't use [-xref r *]. Does any body know a lisp that reloads all the loaded xrefs? Someone must have addressed this before. Please help.

  2. #2
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    It's as toggle switch... type UNRELOAD and XRefs unloads, press Enter or agan type UNRELOAD xrefs loads.

    Code:
    (defun c:unreload(/ cObj cName)
      (setq cObj(tblnext "BLOCK" T))
      (while cObj
        (setq cName(cdr(assoc 2 cObj)))
          (vl-cmdf "_.xref" (if(=(logand(cdr(assoc 70 cObj))32)32)
                   "_unload" "_reload") cName)
      (setq cObj(tblnext "BLOCK"))
      ); end while
       (princ)
      ); end of c:unreload

  3. #3
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Default

    Thanks ASMI, but I don't follow how your lisp can help me here. I'm trying to reload all the xrefs on my dwgs that already loaded and ignore all the xrefs that's not loaded. I've tried your lisp but it only reverse the xrefs status. (ie: unload the loaded xrefs and load the unloaded xrefs) I'm trying to basically refresh my dwg with the same loaded xrefs and keep the unloaded xrefs unloaded. Unless I'm missing some steps I'm suppose to do after running your lisp.

  4. #4
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    Excuse me Unload and reload all loaded XRefs (refresh):

    Code:
    (defun c:unreload(/ cObj cName)
      (setq cObj(tblnext "BLOCK" T))
      (while cObj
        (setq cName(cdr(assoc 2 cObj)))
        (if
          (and
    	 (=(logand(cdr(assoc 70 cObj))32)32)
    	 (=(logand(cdr(assoc 70 cObj))4)4)
    	 ); end and
          (progn
           (vl-cmdf "_.xref" "_unload" cName)
           (vl-cmdf "_.xref" "_reload" cName)
           ); end progn
          ); wnd if
      (setq cObj(tblnext "BLOCK"))
      ); end while
       (princ)
      ); end of c:unreload

  5. #5
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Default THANKS ASMI, it works great!

    Hey Thanks so much ASMI, it works perfectly. What would I do without helpful experts like you to answer questions. I really appreciate your help on this.

  6. #6
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Idea Fine tune the lisp

    Hey ASMI, I'm just wondering is it possible to only reload the loaded xrefs that was changed? AutoCAD obviously knows which one needs to be updated. I don't understand the lisp, so I wasn't sure how it works. It would be super awsome if the lisp only updates the xref that was changed. You see, if I have 10 xrefs loaded and only 1 xref needs to be updated, there's no point of reloading all 10 xrefs.
    Thanks again ASMI for helping out, seems like you always end up answering my lisp questions.

  7. #7
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    I think is possible. May be i make it, maybe at next week... May be...

  8. #8
    Super Member mdbdesign's Avatar
    Computer Details
    mdbdesign's Computer Details
    Operating System:
    XP PRO
    Computer:
    Homemade
    Motherboard:
    GIGABYTE G31M-ES2L
    CPU:
    INTEL CORE 2-QUAD-Q6600@2.4GHz
    RAM:
    4 GB
    Graphics:
    NVIDIA GeForce 9800 gt 1gb
    Primary Storage:
    WESTERN DIGITAL 500GB
    Monitor:
    2 - 21" COMPACQ
    Discipline
    Mechanical
    mdbdesign's Discipline Details
    Occupation
    Designing Engineer in Engineering Department
    Discipline
    Mechanical
    Details
    Pressure tanks Oil processing & storage equip. Steel mill equip. Telecom towers & equip. Wind turbine towers Power plant structures etc.
    Using
    AutoCAD 2012
    Join Date
    Jan 2007
    Location
    Courtice, Ontario, Canada
    Posts
    749

    Default

    Thanks ASMI it work OK for me.
    (no changes required)

  9. #9
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Cool

    I heard they fixed this in AutoCAD 07, is this correct? Either way, we use ADT 04 at work, so doesn't help me anyways.

    ASMI is doing awsome work here, so please thank ASMI for that. I'm refering friends to see this thread for his code.

  10. #10
    Senior Member
    Computer Details
    JeepMaster's Computer Details
    Operating System:
    Vista Business 64-bit
    Computer:
    Dell
    CPU:
    Core2Quad Q9400
    RAM:
    8GB
    Monitor:
    27" Dell 2709W
    Using
    Revit 2011
    Join Date
    Mar 2006
    Location
    Alberta, Canada
    Posts
    291

    Default

    Registered forum members do not see this ad.

    bump bump x2

Similar Threads

  1. COMMAND "SAVE" Lisp Rountine!
    By lacphong in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 17th Jun 2007, 04:04 am
  2. Lisp routine to delete a file form "C" drive
    By muck in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 28th Mar 2007, 09:01 pm
  3. "LINK template" icons "greyed out" -why?
    By Chrisjpritchard in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 2nd Mar 2007, 10:25 pm
  4. Lisp for "dividing" objects
    By fade2blackened in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 16th Mar 2005, 02:55 pm
  5. "Union" Meshes or "Slice" 3D Mesh
    By Peter31712 in forum AutoCAD 3D Modelling & Rendering
    Replies: 1
    Last Post: 29th Apr 2004, 11:11 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts