bad argument type: numberp:
Why is this not working? I tried serching for the answer online but I didn't find anything that helped. When I run the lisp routine, it gives me this "bad argument type: numberp: "30"" the 30 is the user entered Original Scale.; CORRECT SCALE OF OBJECT(DEFUN C:FXS ()(setq DS (getvar 'dimscale))(setq OS (getstring "\nOriginal Scale: "))(PROMPT "\nPick object to SCALE : ")(setq A (ssget))(setq DST (rtos DS 2 4))(setq OST (rtos OS 2 4))(SETQ SF (/ DST OST))(COMMAND "scale" A "" PAUSE SF)(princ)) Consider the data types of your variables:
; CORRECT SCALE OF OBJECT(DEFUN C:FXS () ;; DS is a REAL (setq DS (getvar 'dimscale)) ;; OS is a STRing (setq OS (getstring "\nOriginal Scale: ")) (PROMPT "\nPick object to SCALE : ") ;; A is a PICKSET (or nil) (setq A (ssget)) ;; DST is a STRing (setq DST (rtos DS 2 4)) ;; Error since OS is a STRing (not a REAL) (setq OST (rtos OS 2 4)) ;; Attempting to divide two STRings (SETQ SF (/ DST OST)) (COMMAND "scale" A "" PAUSE SF) (princ)) I would advise to look into the variations of (get...) callsalong wih ( initget ).It makes life so much easier.-David
页:
[1]