clint0577 Posted December 12, 2012 Share Posted December 12, 2012 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) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 12, 2012 Share Posted December 12, 2012 Consider the data types of your variables: ; CORRECT SCALE OF OBJECT (DEFUN C:FXS () [color=red];; DS is a REAL[/color] (setq DS (getvar 'dimscale)) [color=red];; OS is a STRing[/color] (setq OS (getstring "\nOriginal Scale: ")) (PROMPT "\nPick object to SCALE : ") [color=red];; A is a PICKSET (or nil)[/color] (setq A (ssget)) [color=red];; DST is a STRing[/color] (setq DST (rtos DS 2 4)) [color=red];; Error since OS is a STRing (not a REAL)[/color] (setq OST (rtos OS 2 4)) [color=red];; Attempting to divide two STRings[/color] (SETQ SF (/ DST OST)) (COMMAND "scale" A "" PAUSE SF) (princ) ) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted December 12, 2012 Share Posted December 12, 2012 I would advise to look into the variations of (get...) calls along wih ( initget ) . It makes life so much easier. -David Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.