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?

  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,536
    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 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,463
    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
    38
    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" ?
    Tuomo

  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,754
    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 Revitaoist's Avatar
    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 Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,463
    Login to Give a bone
    0

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

    Quote Originally Posted by rhershberger View Post
    You could do this in minutes with the reference manager: -Start Menu - All Programs - Autodesk -Autocad 20XX - Reference Manager
    Really? I didn't think the Reference Manager allowed the filename change of the xref file itself. When did that get added?
    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

  9. #9
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    1

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

    Quote Originally Posted by Opie View Post
    Really? I didn't think the Reference Manager allowed the filename change of the xref file itself. When did that get added?
    Reference Manager does not handle changing the XRef filename. It only works to change the path of the XRef. (But Opie knows that.)
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  10. #10
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,536
    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 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

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
  •