See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: How to use a different xref and change path?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2010-02
    Posts
    5
    Login to Give a bone
    0

    Default How to use a different xref and change path?

    Hello, I have to change the xrefs of 400 files. I was wondering if anyone have a fast lisp or programming routine to use.

    Basically we have files named superbuilding1-floor1 found in C:/files/superbuilding1-floor1.dwg but now the file would be called superbuilding1-abc found in Z:files/superbuilding1abc.

    The name of the new xref is very similar so it is possible to use a wild card character like building1* Unfortunately the last parts of the dwg names is not always going to be the same.

    The old path and the new path will always be the same location. What would be the easiest way to do this?
    Thank you very much. I looked up some of the other routines but none of them seem to be making this process any faster. Any advice is appreciated.

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

    Default Re: How to use a different xref and change path?

    Edit: Congrats on your first post, and welcome to the forums!

    Have you tried using Reference Manager..?
    Last edited by RenderMan; 2010-10-13 at 12:55 PM. Reason: Greeting
    "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. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: How to use a different xref and change path?

    How will the routine know the new name of the xref? Do you have a list already for which drawing contains the current xref and the proposed xref?
    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

  4. #4
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    49
    Login to Give a bone
    0

    Default Re: How to use a different xref and change path?

    How about using Express - tool "redir", perhaps combined with "DoFile.lsp" ?

  5. #5
    Member
    Join Date
    2010-02
    Posts
    5
    Login to Give a bone
    0

    Default Re: How to use a different xref and change path?

    Oh ahah I didn't realize that was my first post here.

    I figured similar to this:

    (command "-xref" "_a" * (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 8)*)

    Of course this does not work because I randomly added the * * to represent wildcards.

    (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 8)) is something I know would get the drawing name and remove the last 8 characters. So the drawing being 'Building-F03.dwg would now store the word Building. The only issue is not being able to add in the wildcard after. I was curious if it was possible to attach wildcard characters. Probably not eh?

    I'll give the redir a try!
    Last edited by Opie; 2010-10-15 at 02:39 PM. Reason: disabled smilies

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

    Default Re: How to use a different xref and change path?

    Quote Originally Posted by tslam View Post
    (command "-xref" "_a" * (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) *)

    (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) )
    Editing note: If you will edit your post (go to Advanced edit if necessary), scroll down to the Additional options, and you can disable smilies for a single post, which are showing up when you have an eight and and closed parenthesis like this , when it should look like this 8)

    (You can also do this at the time of a new post)
    R.K. McSwain | CAD Panacea |

  7. #7
    I could stop if I wanted to
    Join Date
    2009-11
    Posts
    380
    Login to Give a bone
    0

    Default Re: How to use a different xref and change path?

    You could do this in minutes with the reference manager: -Start Menu - All Programs - Autodesk -Autocad 20XX - Reference Manager

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

    Default Re: How to use a different xref and change path?

    If this statement is true:

    Quote Originally Posted by tslam View Post
    Basically we have files named superbuilding1-floor1 found in C:/files/superbuilding1-floor1.dwg but now the file would be called superbuilding1-abc found in Z:files/superbuilding1abc.
    Then the Reference Manager suggestion is your best solution.

    Regardless of the filenames being similar, the file path is *unique*. This makes changing the reference path necessary, and not renaming the reference itself.

    Hope this helps!
    "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

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

    Default Re: How to use a different xref and change path?

    Quote Originally Posted by RenderMan View Post
    If this statement is true:



    Then the Reference Manager suggestion is your best solution.

    Regardless of the filenames being similar, the file path is *unique*. This makes changing the reference path necessary, and not renaming the reference itself.

    Hope this helps!
    The Reference Manager will not rename the filename of a referenced file within a drawing. It will only change the folder path.

    If the filename must be changed, you either have to do it manually or code a suitable automated solution. Reference Manager will not handle this problem.
    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

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

    Default Re: How to use a different xref and change path?

    Quote Originally Posted by Opie View Post
    The Reference Manager will not rename the filename of a referenced file within a drawing. It will only change the folder path.

    If the filename must be changed, you either have to do it manually or code a suitable automated solution. Reference Manager will not handle this problem.
    Opie is correct, I am mistaken.

    Edit: Ehhehe... I guess that's the difference between my 600 psosts, and Opie's +6,000. lol

    I've just tried to remap the current reference to a copy of the original reference... and it did not work. Only the path can be revised.

    Interestingly, if you right click the reference and go to properties, you can rename the reference file, but this does not update the container drawings reference (i.e., it still has the old file name).

    I am surprised that Autodesk failed to include this capability when the released reference manager. The version I have is 2009, can anyone clarify if a newer version includes this capability?
    Last edited by RenderMan; 2010-10-15 at 02:09 PM.
    "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

Page 1 of 2 12 LastLast

Similar Threads

  1. Change xref path type
    By jdcincy in forum AutoLISP
    Replies: 14
    Last Post: 2012-04-24, 04:50 PM
  2. rename and change xref path
    By krkeec763189 in forum Dot Net API
    Replies: 0
    Last Post: 2011-12-22, 01:29 PM
  3. Change xref name and path
    By krkeec763189 in forum AutoLISP
    Replies: 11
    Last Post: 2011-12-13, 06:56 AM
  4. Change Xref from Full Path to Relative Path
    By ccowgill in forum AutoLISP
    Replies: 6
    Last Post: 2009-05-27, 11:54 AM
  5. Replies: 1
    Last Post: 2007-05-05, 02:59 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
  •