乐筑天下

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

[编程交流] 错误的参数类型:fixnump:

[复制链接]

27

主题

126

帖子

99

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
135
发表于 2022-7-6 08:49:14 | 显示全部楼层 |阅读模式
大家好,好久不见
 
我对这段粗体代码的第一部分有问题。我在plot LISP中添加了用于打印多个副本的选项。然而,我不断得到一个错误“错误的参数类型:fixnump:”。
 
我希望复制量默认设置为1,如果用户按enter键而不键入数字,则只打印1份。
 
  1. (defun Laser5500 (/ myPLOLayoutList mylayout)
  2. (setq totcopy 1)
  3. [b](setq totalcopy
  4.    (cond
  5.      (
  6.        (eq ""
  7.          (setq totalcopy
  8.            (getint
  9.              (strcat "\nHow many copies to be printed <1>: "
  10.              )
  11.            )
  12.          )
  13.        )
  14.        totcopy
  15.      )
  16.      ( totalcopy )
  17.    )
  18. )  [/b]
  19.      (EXPLO_db1_Main)
  20.      (setvar "cmdecho" 0)
  21.      (setq imagef (getvar "imageframe"))
  22.      (setvar "imageframe" 2)
  23.      (command "wipeout" "frames" "off")
  24.    (setq mylayout (length myPLOLayoutList))
  25. (repeat totalcopy
  26.      (if myPLOLayoutList                        
  27.        (progn                           
  28.        (setq                            ; Begin setq for myLayout
  29.            myLayout (getvar "CTAB"))            ; End setq for myLayout
  30.        (foreach myLayout (reverse myPLOLayoutList)
  31.          (command "-plot"                    ; Command: -plot
  32.            "Y"                         ; Detailed plot configuration? [Yes/No]
  33.            mylayout                    ; Layout Name
  34.            "NP2-HPCLJ5500.pc3"                ; Output Device Name
  35.            "11x17"                        ; Paper Size
  36.            "Inches"                    ; Paper Units
  37.            "Landscape"                    ; Drawing Orientation [Portrait/Landscape]
  38.            "No"                        ; Plot Upside Down? [Yes/No]
  39.            "Extents"                    ; Plot Area [Display/Extents/Limits/View/Window]
  40.            "1=1"                        ; Plot Scale (Plotted Inches=Drawing Units) or [Fit]
  41.            "Center"                    ; Plot Offset (x,y) or [Center] <Center>
  42.            "Yes"                        ; Plot Styles? [Yes/No]
  43.            "monochrome.ctb"                ; Plot Style Table Name or [?] (enter . for none)
  44.            "Yes"                        ; Plot Lineweights [Yes/No]
  45.            "No"                        ; Scale Lineweights [Yes/No]
  46.            "No"                        ; Plot Paper Space First? [Yes/No]
  47.            "No"                        ; Hide Paperspace Objects? [Yes/No]
  48.            "No"                        ; Plot to a File [Yes/No]
  49.            "No"                        ; Save Changes to Page Setup [Yes/No]
  50.            "Yes")                        ; Proceed With Plot [Yes/No]
  51.         )))
  52.    )
  53.    (setvar "imageframe" imagef)
  54.      (setvar "cmdecho" 1)
  55.        (princ "\n ---------------------------------------------")
  56.       (princ (strcat "\n ------ Express Plotting - Version " PLOVerNum " ------"))
  57.      (princ "\n ---------------------------------------------")
  58.      (princ)
  59. )
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:21:14 | 显示全部楼层
首先,要理解您收到的错误消息,请参阅此处,看看您是否可以告诉我代码的哪一部分崩溃了。
 
现在,为了理解您收到该错误消息的原因,请注意,如果用户按Enter键,getint将返回nil,而不是空字符串。看看本教程,特别是最后一个示例。
回复

使用道具 举报

27

主题

126

帖子

99

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
135
发表于 2022-7-6 10:18:39 | 显示全部楼层
谢谢李。你的教程很有帮助。很明显,我错过了ITOA和其他一些不合适的东西。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 08:11 , Processed in 0.486916 second(s), 58 queries .

© 2020-2025 乐筑天下

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