See the top rated post in this thread. Click here

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

Thread: help with expresstools - redir lisp routine

  1. #1
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default help with expresstools - redir lisp routine

    I would like to use a lisp routine to run the redir.lsp routine for repathing xrefs.

    I tried:

    Code:
    (C:REDIR)
    (COMMAND "*" )
    (command "S:\2007_FILES\job\ARCH\SHEETS\")
    It seems to stop after c:redir.
    Any help how to do this with a lisp routine?


    Thanks,
    Chris

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    You can't use a lisp like that from a lisp. You might be able to use it in a script file though.

  3. #3
    100 Club
    Join Date
    2005-09
    Posts
    111
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by FRAMEDNLV View Post
    I would like to use a lisp routine to run the redir.lsp routine for repathing xrefs.

    I tried:

    Code:
    (C:REDIR)
    (COMMAND "*" )
    (command "S:\2007_FILES\job\ARCH\SHEETS\")
    It seems to stop after c:redir.
    Any help how to do this with a lisp routine?


    Thanks,
    Chris
    Chris,
    Like this?
    Code:
    (defun C:test1()
    (command "REDIR" "" "X" "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    )
    or
    Code:
    (defun C:test2()
    (command "REDIRMODE" "X")
    (command "REDIR" "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    )
    HofCAD CSI

  4. #4
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by hofcad View Post
    Chris,
    Like this?
    Code:
    (defun C:test1()
    (command "REDIR" "" "X" "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    )
    or
    Code:
    (defun C:test2()
    (command "REDIRMODE" "X")
    (command "REDIR" "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    )
    HofCAD CSI
    None of those work, but thanks.

    I think T.Willey is correct.

    I was able to re-write the redir lisp to do what I wan't but I have to create one for each path.


    Thanks,
    Chris

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

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by hofcad View Post
    (defun C:test1()
    (command "REDIR" "" "X" "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    )[/code]
    Unfortunately (command doesn't work for custom lips. The only way of calling that command from LISP is (c:Redir). Unfortunately AC then passes execution to the Redir function, which is waiting for user input. But your lisp calling the redir is paused until Redir finishes.

    I think the only way of doing this is through a SCR file. Maybe you could create a temporary SCR file from a Lisp, then load it with (command "_script" filename).

  6. #6
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by irneb View Post
    Unfortunately (command doesn't work for custom lips. The only way of calling that command from LISP is (c:Redir). Unfortunately AC then passes execution to the Redir function, which is waiting for user input. But your lisp calling the redir is paused until Redir finishes.

    I think the only way of doing this is through a SCR file. Maybe you could create a temporary SCR file from a Lisp, then load it with (command "_script" filename).
    Thanks,
    I have been doing is via script for some time now. I was trying to avoid some issues that I have with general scripts and job specific scripts.

    I might look into creating a lisp based on the redir.lsp.


    Thanks,
    Chris

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

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by FRAMEDNLV View Post
    I might look into creating a lisp based on the redir.lsp.
    That's probably the most efficient solution in the long run. As a Tip, c:Redir basically handles user input then calls the (bns_redir path1 path2), which decides if it's a XRef, Style, Image or RText; and then runs the relevant function. So all you realy need do is create a copy of the c:Redir defun (rename it Redir for example), add 2 input parapeters & replace the code asking for user input by simply assigning the path1 & path2 with the 2 input parameters. Then you can call the new function with
    Code:
    (Redir "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")

  8. #8
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    Quote Originally Posted by irneb View Post
    That's probably the most efficient solution in the long run. As a Tip, c:Redir basically handles user input then calls the (bns_redir path1 path2), which decides if it's a XRef, Style, Image or RText; and then runs the relevant function. So all you realy need do is create a copy of the c:Redir defun (rename it Redir for example), add 2 input parapeters & replace the code asking for user input by simply assigning the path1 & path2 with the 2 input parameters. Then you can call the new function with
    Code:
    (Redir "*" "S:\\2007_FILES\\job\\ARCH\\SHEETS\\")
    I did that some time back and set path2 to the current directory. That has worked out great for single folder fixes. It is actually part of our standard cleanup routine, which is a script file (the reason I want to use a lisp routine).

    I also have a version that I code the path in the lisp, but I have to make multiple copies for each path. It checks each path for each xref and takes a while to complete (one job has over fifty folders). I then need to write a custom cleanup routine for that job, which wouldn't get new fixes added like our standard cleanup routine.

    What I would like to do is for each xref have a list of folders (perhaps a text file) to check the path until it finds the dwg file and then go to the next xref (like useing projectname).

    Side note:
    I would use projectname but it seems to crash after seven directories are added (V2004-200?). It would also need to be updated on all workstations/profiles.

    Thanks,
    Chris

  9. #9
    Member
    Join Date
    2012-03
    Posts
    4
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    When I use the redir command, it says:

    "Changes to some externally referenced objects may be temporary."

    In fact, all of the changes are temporary. After I save, when I reopen the files, all of the xrefs have reverted back.

    Any thoughts?

    Thanks!

  10. #10
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: help with expresstools - redir lisp routine

    I think it has something to do with nested xref's

Page 1 of 2 12 LastLast

Similar Threads

  1. Calling up LISP routine from within another LISP
    By jimmy_goodall in forum AutoLISP
    Replies: 4
    Last Post: 2013-08-21, 05:56 AM
  2. NEED HELP WITH LISP ROUTINE - PURGE linetype lisp
    By ECASAOL350033 in forum AutoLISP
    Replies: 6
    Last Post: 2013-06-21, 01:13 AM
  3. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 10:33 PM
  4. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 12:14 PM
  5. Replies: 9
    Last Post: 2012-01-21, 07:58 AM

Posting Permissions

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