rajrehman Posted July 26, 2012 Posted July 26, 2012 I have problem to lsp programme run the programe autocad give ; error: bad argument type: numberp: nil error please help me here is my programme (DEFUN C:nallano() (COMMAND "LAYER" "m" "nalano""c" "w""" "m" "cbarea""c" "r" """m" "boundary""c" "y" """") (SETQ NANO(GETSTRING"\nENTER NALLA NUMBER :")) (setq cbno(getreal"enter catch basin no :")) (while (SETQ PT (GETPOINT"SELECT THE POINT FOR CALCULATING AREA OF BOUNDARY :")) (COMMAND "LAYER" "S" "boundary" "") (command"boundary" PT "") (setq ENTl (entget (entlast))) (command "area" "Object" "last") (setq plotarea (getvar "area" )) ; (princ plotarea)(getreal"....") ; (command"erase" "last" "" ) ;(COMMAND"DDATTE" PAUSE) (WRITETEXT plotarea pt) (setq chno (+ 1 chno)) ) ) (defun writetext(plotarea pt) (SETQ MAXLV(GETSTRING"\ENTER THE Maximum High Level :")) (SETQ NALVL(GETSTRING"\ENTER THE Nala Invert Level :")) (setq orgpt pt) (setq wrtpt(list (car orgpt)(+(cadr orgpt)2))) (setq wrtpt1(list (car orgpt)(+(cadr orgpt)4))) (command"insert" "nalano" pt "" "" "0" SHNO surno hno (rtos chno 2 0) (rtos plotarea 2 3) ) ;(COMMAND "LAYER" "S" "chaltano" "") ;(command"text" "Ml" ORGPT 1 0 (rtos chno 1 0)) ; (COMMAND "LAYER" "S" "hissa-number" "") ; (command"text" "MC" WRTPT 1 0 hno) ; (COMMAND "LAYER" "S" "charea" "") ; (command"text" "MC" WRTPT1 2 0 (rtos plotarea 2 3)) ) Quote
SLW210 Posted July 26, 2012 Posted July 26, 2012 Please Read the CODE POSTING GUIDELINES and edit your post! Please create new threads and not add posts to unrelated topics. Quote
MSasu Posted July 26, 2012 Posted July 26, 2012 You should check this line - the value for first 4 variables (in red) that you attempt to pass as attributes are evaluated to nil: (command "insert" "nalano" pt "" "" "0" [color=red]SHNO surno hno[/color] (rtos [color=red]chno[/color] 2 0) (rtos plotarea 2 3)) Also this line would generate an error since the variable isn't initialized: (setq chno (+ 1 chno)) Quote
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.