rename problem..

Discussion in 'AutoCAD' started by C Witt, Jul 28, 2003.

  1. C Witt

    C Witt Guest

    also.. lol.. how do i get it to run?.. i loaded it (as is).. and it
    won't do anything..

    Am I suposed to do something with (defun dimfilter (ss name / i rtn
    item) ??
     
    C Witt, Jul 30, 2003
    #21
  2. C Witt

    C Witt Guest

    OK.. I have attached a modified version of your (last) script.. please
    tell me what i'm doing wrong..




    (defun c:dimFilter (ss name / i rtn item)
    (setvar "cmdecho" 0)
    (foreach n'("AT&T1-16" "AT&T3-32" "AT&T1-8" "AT&T3-16" "AT&T1-4" "AT&T3-8" "AT&T1-2" "AT&T3-4" "AT&T1" "AT&T1-1-2" "AT&T2" "AT&T3" "AT&T1-1" "AT&T1-10FT" "AT&T1-20FT" "AT&T1-30FT" "AT&T1-40FT" "AT&T1-50FT" "AT&T1-100FT" "AT&T1-150FT" "AT&T1-200FT" "AT&T1-300FT" "AT&T1-400FT" "AT&T1-500FT" "TRKIMP1-16" "TRKIMP3-32" "TRKIMP1-8" "TRKIMP3-16" "TRKIMP1-4" "TRKIMP3-8" "TRKIMP1-2" "TRKIMP3-4" "TRKIMP1" "TRKIMP1-1-2" "TRKIMP2" "TRKIMP3" "TRKIMP1-1" "TRKIMP1-10FT" "TRKIMP1-20FT" "TRKIMP1-30FT" "TRKIMP1-40FT" "TRKIMP1-50FT" "TRKIMP1-100FT" "TRKIMP1-150FT" "TRKIMP1-200FT" "TRKIMP1-300FT" "TRKIMP1-400FT" "TRKIMP1-500FT")
    (setq OLDDIM n)
    (if (or (= OLDDIM "AT&T1-16")(= OLDDIM "TRKIMP1-16"))(setq NEWDIM "1-16'' - 1FT"))
    (if (or (= OLDDIM "AT&T3-32")(= OLDDIM "TRKIMP3-32"))(setq NEWDIM "3-32'' - 1FT"))
    (if (or (= OLDDIM "AT&T1-8")(= OLDDIM "TRKIMP1-8"))(setq NEWDIM "1-8'' - 1FT"))
    (if (or (= OLDDIM "AT&T3-16")(= OLDDIM "TRKIMP3-16"))(setq NEWDIM "3-16'' - 1FT"))
    (if (or (= OLDDIM "AT&T1-4")(= OLDDIM "TRKIMP1-4"))(setq NEWDIM "1-4'' - 1FT"))
    (if (or (= OLDDIM "AT&T3-8")(= OLDDIM "TRKIMP3-8"))(setq NEWDIM "3-8'' - 1FT"))
    (if (or (= OLDDIM "AT&T1-2")(= OLDDIM "TRKIMP1-2"))(setq NEWDIM "1-2'' - 1FT"))
    (if (or (= OLDDIM "AT&T3-4")(= OLDDIM "TRKIMP3-4"))(setq NEWDIM "3-4'' - 1FT"))
    (if (or (= OLDDIM "AT&T1")(= OLDDIM "TRKIMP1"))(setq NEWDIM "1'' - 1FT"))
    (if (or (= OLDDIM "AT&T1-1-2")(= OLDDIM "TRKIMP1-1-2"))(setq NEWDIM "1 1-2'' - 1FT"))
    (if (or (= OLDDIM "AT&T2")(= OLDDIM "TRKIMP2"))(setq NEWDIM "2'' - 1FT"))
    (if (or (= OLDDIM "AT&T3")(= OLDDIM "TRKIMP3"))(setq NEWDIM "3'' - 1FT"))
    (if (or (= OLDDIM "AT&T1-1")(= OLDDIM "TRKIMP1-1"))(setq NEWDIM "1'' - 1''"))
    (if (or (= OLDDIM "AT&T1-10")(= OLDDIM "TRKIMP1-10"))(setq NEWDIM "1'' - 10FT"))
    (if (or (= OLDDIM "AT&T1-20")(= OLDDIM "TRKIMP1-20"))(setq NEWDIM "1'' - 20FT"))
    (if (or (= OLDDIM "AT&T1-30")(= OLDDIM "TRKIMP1-30"))(setq NEWDIM "1'' - 30FT"))
    (if (or (= OLDDIM "AT&T1-40")(= OLDDIM "TRKIMP1-40"))(setq NEWDIM "1'' - 40FT"))
    (if (or (= OLDDIM "AT&T1-50")(= OLDDIM "TRKIMP1-50"))(setq NEWDIM "1'' - 50FT"))
    (if (or (= OLDDIM "AT&T1-100")(= OLDDIM "TRKIMP1-100"))(setq NEWDIM "1'' - 100FT"))
    (if (or (= OLDDIM "AT&T1-150")(= OLDDIM "TRKIMP1-150"))(setq NEWDIM "1'' - 150FT"))
    (if (or (= OLDDIM "AT&T1-200")(= OLDDIM "TRKIMP1-200"))(setq NEWDIM "1'' - 200FT"))
    (if (or (= OLDDIM "AT&T1-300")(= OLDDIM "TRKIMP1-300"))(setq NEWDIM "1'' - 300FT"))
    (if (or (= OLDDIM "AT&T1-400")(= OLDDIM "TRKIMP1-400"))(setq NEWDIM "1'' - 400FT"))
    (if (or (= OLDDIM "AT&T1-500")(= OLDDIM "TRKIMP1-500"))(setq NEWDIM "1'' - 500FT"))
    (setq name (strcase OLDDIM))
    (setq i 0)
    (setq rtn (ssadd))
    (repeat (sslength ss)
    (setq item (ssname ss i))
    (if
    (wcmatch
    (strcase
    (vla-get-stylename
    (vlax-ename->vla-object item))
    )
    NEWDIM
    )
    (ssadd item rtn)
    )
    (setq i (1+ i))
    )
    (if (> (sslength ss) 0) rtn)
    (if (= (tblsearch "dimstyle" OLDDIM) nill)()(command "purge" "d" OLDDIM "N"))
    )
    (if (= (tblsearch "dimstyle" "standard") nill)()(command "purge" "d" "standard" "N"))
    ;(setvar "cmdecho" 1)
    (princ)
    )
     
    C Witt, Jul 30, 2003
    #22
  3. .....er that last part shold have been

    (if (> (sslength rtn) 0) rtn)
     
    Jason Piercey, Aug 5, 2003
    #23
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.