Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: Lisp to set Xref path

  1. #21
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    I really must know, what does the VISRETAIN system variable have to do with this? It is for maintaining visual changes to layers contained in xrefs.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  2. #22
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    Quote Originally Posted by Opie View Post
    I really must know, what does the VISRETAIN system variable have to do with this? It is for maintaining visual changes to layers contained in xrefs.
    Exactly that, *Detective Angel*.

    The OP made no mention of either retaining the reference's present visual settings, or restoring the reference's saved state. This was simply stated as a potential enhancement, as this variable's setting has direct impact on the result of the reloaded xrefs.

    More specifically, I made reference to changing visretain while testing the routine, as noted in post #15:

    Quote Originally Posted by RenderMan View Post
    I opened our master line work drawing, and referenced in our master contour drawing (same directory as active drawing), then I referenced all roadway plan sheets (from a separate directory), and proceeded to change the layer of all layers containing *|* to red (only xref layers). Changed visretain=0.

    Ran my routine, and walla! only the master contour drawing reloaded [to it's original layer colors].
    I hope that my (logical?) reason was not misleading, as modifying the variable is not required, simple worthy of consideration.

    Sorry for the confusion, I didn't mean for this to create a subtopic, I assure you.
    Last edited by RenderMan; 2010-09-16 at 05:40 PM. Reason: Typo
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #23
    Member
    Join Date
    2010-04
    Posts
    14
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    I hate to even tell you, but it detached everything without reloading anything.

    I get the drawings from other companies so the saved path doesn't even exist on my machine. I keep saying in the same directory because that is where we put all the xref's at, they would not be located in any other folder on our computers.

    When I look at the xref manager all of the xref's are either unloaded or not found or unreferenced. I want it to load the ones that I have, because I may or may not have received all of them.

    All of the drawings that I do not have display a saved to path that does not exist. However the drawings that they did send me have a path that is just the drawing name.

    Why doesn't autocad load this xref's when it opens the drawing since they are right there in the same folder as the main drawing? That would fix it. Maybe I should be searching this instead.

  4. #24
    Member
    Join Date
    2010-04
    Posts
    14
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    Maybe I am off in left field somewhere and should be approaching this from a different angle. I hate to waste your time.

    I am going to keep studying.

  5. #25
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    No worries. I really appreciate your patience with my attempts, and will not continue to hound you. I'm just glad someone here (Cadtag) was able to help you find an acceptable solution.

    I am just utterly at a loss as to why this (my) routine will not work for you.

    Every attempt I make to replicate your results, ends with my routine succeeding (as planned). I've just attached an external reference from another directory, from an external client, with no path selected, and my routine works.

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

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  6. #26
    Member
    Join Date
    2010-04
    Posts
    14
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    I went to a different computer and when I call up the AutoCAD files it loads the xrefs like it is supposed to. I must have an option turned off on mine. Now I get to do a search for that.

  7. #27
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    This could just be my lack on experience shining through, but there is no AutoCAD setting which loads all xrefs at drawing open (that I know of).

    *IF* I am correct, one would require a custom routine which loads when you open a drawing (ACADDOC.lsp?), to do this.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  8. #28
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    Quote Originally Posted by tbeaman View Post
    Why doesn't autocad load this xref's when it opens the drawing since they are right there in the same folder as the main drawing? That would fix it. Maybe I should be searching this instead.
    Yes! That would be my suggestion.

    Quote Originally Posted by RenderMan View Post
    This could just be my lack on experience shining through, but there is no AutoCAD setting which loads all xrefs at drawing open (that I know of).

    *IF* I am correct, one would require a custom routine which loads when you open a drawing (ACADDOC.lsp?), to do this.
    Correct, there is no setting. It's built into AutoCAD, that is just how it works.
    Check out the User's Guide > Share Data Between Files > Reference Other Drawing Files > Resolve Referenced Drawing Errors

    Xrefs are searched for in this order: (BTW: I must have been mistaken earlier, I thought the first two were reversed)

    PHP Code:
    The original xref path
    Current folder of the host drawing
    Project search paths defined on the Files tab in the Options dialog box and in the PROJECTNAME system variable
    Support search paths defined on the Files tab in the Options dialog box
    Start In folder specified in the Microsoft® Windows® application shortcut 
    R.K. McSwain | CAD Panacea |

  9. #29
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    Thanks for the clarification / reminder, RK.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  10. #30
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Lisp to set Xref path

    Just a note to RenderMan. Your routine should work fine in most cases. However, it is possible to have xrefs loaded from dwg files which are named differently to the xref block definition's name. Two ways this may have come about:
    1. The user used the rename command / right-click on xref in manager and renamed the block ... for whatever purpose (I sometimes do this so I can have 2 versions of the xref with different layer settings).
    2. The user's browsed to another file to load the xref from such. I sometimes do this when creating RCPs (or finishes layouts). Makes creating such much less of a chore, since it's just a saveas and rename operation. No need to redo the layer settings (even using layer states is more work) ... usually though I do 1 first so I know (later) that this is the case
    If either of those has happened your routine searches for the xref by its block name, not its file name. So if I have Plan-Level1.DWG xreffed as Plan your routine would search for Plan.DWG ... which it will never find.

    So instead of using (setq xrefName (vla-get-name x)) ... I'd suggest using something like:
    Code:
    (setq xrefName (vl-filename-base (vla-get-Path x)))
    Although that may be undefined if it's unloaded ... oh well! Fortunately for me we never bind ... use eTransmit exclusively.

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Xref path - Saved path vs. Found at
    By jsowinski in forum AutoLISP
    Replies: 21
    Last Post: 2010-08-27, 06:11 AM
  2. Xref Path
    By Ehsan in forum AutoLISP
    Replies: 15
    Last Post: 2010-05-02, 04:44 AM
  3. Change Xref from Full Path to Relative Path
    By ccowgill in forum AutoLISP
    Replies: 6
    Last Post: 2009-05-27, 11:54 AM
  4. Xref path to no path
    By hostetterkl in forum AutoLISP
    Replies: 2
    Last Post: 2005-08-10, 09:48 PM
  5. Relevative Path vs Full Path Xref Swap *
    By tomdillenbeck in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2005-05-26, 06:19 PM

Posting Permissions

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