Page 1 of 1

Autocad Lisp Question (simple)

Posted: Mon Jul 28, 2014 12:53 pm
by Canuck7783
I had the lisp below running on autocad 2002 with no problems. I put it on a machine that is running Autocad 2014 and I have one small problem. When I was on autocad 2002 I could select an object line and then run my lisp program (WW) and it would change to the correct layer "PART". On the autocad 2014 machine, it won't let me do it. I have to run the lisp program first, it then asks me to select the object layer you want to change and then it changes to the correct layer. I already messed around with the "Pickfirst" option and that isn't it. Is there something wrong with my coding that I'm not seeing. Thank you


LISP Program -
; ---------------------------PART LISP--------------------------
; CHANGES A SELECTED OBJECTS LAYER TO LAYER "PART"
; ----------------------------------------------------------------


(Defun C:WW (/ SS CNT LAY)

(setvar "cmdecho" 0)
(if (not (tblsearch "LAYER" "hidden"))
(command "Layer" "N" "PART" "C" "green" "PART" "LT" "continuous" "PART" "" ""))

(if (not (setq SS (ssget "i")))
(progn
(prompt "\nSelect objects to be CHANGED to layer PART: ")
(setq SS (ssget))
)
)

(if SS
(command "_.change" SS "" "_p" "_la" "PART" "")
(if (= (sslength SS) 1)
(prompt (strcat "\nOne object changed to layer "PART"))
(prompt (strcat "\n" (itoa (sslength SS)) "objects changed to layer "PART")
)
)
)

(setvar "cmdecho" 1)

(princ)
)

Re: Autocad Lisp Question (simple)

Posted: Thu Jul 31, 2014 5:32 am
by pjstirling
Erm, why are you asking this in the common-lisp forum and not the Other Dialects (which explicitly list autolisp)?