Repathing question - Please help

Discussion in 'AutoCAD' started by Jamie Duncan \(remove lock to reply\), Apr 9, 2004.

  1. I'm trying to use lisp as part of a start-up routine to fix some repathing
    issues.

    Here is the test.lsp as it stands now:

    (setq flag1 T)
    (while (setq end1 (tblnext "block" flag1))
    (setq flag1 nil)Z(princ end1)
    (if (and (= (cdr (assoc 0 end1)) "BLOCK")(= (logand (cdr (assoc 70
    end1)) 4) 4)(= (logand (cdr (assoc 70 end1)) 32) 0))
    (progn
    (setq xr_path (cdr (assoc 1 end1)) xr_name (cdr (assoc 2 end1))
    dwg_name (getvar "dwgname") dwg_path (getvar "dwgprefix")
    )(princ "\nthis is the data")(princ end1)
    (setq end1 (subst (cons 1 (strcat dwgprefix xr_name))(assoc 1
    end1) end1));;; this is where we seem to fail
    (entmod end1)
    )
    )
    )


    any ideas would be very welcome. thanks (I think it's a data type problem)




    --
    Jamie Duncan

    "Maybe the Hokey Pokey is REALLY what's it all about"

    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 9, 2004
    #1
  2. Jamie,

    You're trying to change the path to the directory of the current dwg?


    (while (setq end1 (tblnext "block" flag1))
    (setq flag1 nil)
    ;(princ "\n---------------\n")
    ; (princ end1)
    (if (and (= (cdr (assoc 0 end1)) "BLOCK")
    (= (logand (cdr (assoc 70 end1)) 4) 4)
    (= (logand (cdr (assoc 70 end1)) 32) 32)) ; <- 32 instead of 0
    (progn
    (setq xr_path (cdr (assoc 1 end1))
    xr_name (cdr (assoc 2 end1))
    dwg_name (getvar "dwgname")
    dwg_path (getvar "dwgprefix")
    )
    (princ "\n### Wahoo: this is the data before: ")(princ end1)
    (setq end1 (subst (cons 1 (strcat dwg_path ; <- was dwgprefix
    xr_name
    ".dwg" ; <- shouldn't that also be present?
    ))
    (assoc 1 end1) end1));;; this is where we seem to fail
    (princ "\n\n+++ and the data after subst: ")(princ end1)
    (entmod end1)
    )
    (princ "\n* ")
    )
    )


    hth
    ruul
     
    ruul morawetz, Apr 9, 2004
    #2
  3. I knew someone would pose that!

    Nah, I have some repathing issues for 100's of drawings due to server
    reorganisation and this is just a test to make sure that everything is on
    the right track...

    The repathing will involve - check current dwg path, character by character
    and compare character by character with the xref path and then make
    intellugent decisions based on the restructuring

    Nice to see you again Ruul!




    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 9, 2004
    #3
  4. I knew someone would pose that!

    well, you set 4 variables and used a 5th,
    so it was just an innocent question because I just took the dwg_path and
    inserted it to get it running.
    ;-)
    You too
    ruul

    p.s.: The "intelligent decisions" I'd sure like to see when they are
    finished.
     
    ruul morawetz, Apr 9, 2004
    #4
  5. This girl needs to have a long rest. Thanks for pointing out the obvious in
    such a pleasant fashion....

    Goodnight Ruul!


    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 9, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.