Jump to content

Recommended Posts

Posted

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))

)

Posted

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))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...