乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 32|回复: 2

[编程交流] LISP, Bad Argument Type

[复制链接]

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 07:42:05 | 显示全部楼层 |阅读模式
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))
)
回复

使用道具 举报

4

主题

2143

帖子

2197

银币

限制会员

铜币
-24
发表于 2022-7-6 08:34:03 | 显示全部楼层
Please Read the CODE POSTING GUIDELINES and edit your post!
 
Please create new threads and not add posts to unrelated topics.
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 09:11:20 | 显示全部楼层
You should check this line - the value for first 4 variables (in red) that you attempt to pass as attributes are evaluated to nil:
  1. (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:
  1. (setq chno (+ 1 chno))
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-9 22:01 , Processed in 0.663124 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表