乐筑天下

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

[编程交流] bad argument type: numberp:

[复制链接]

9

主题

21

帖子

12

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 07:10:35 | 显示全部楼层 |阅读模式
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.
 
  1. ; 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))
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:08:20 | 显示全部楼层
Consider the data types of your variables:
 
  1. ; 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))
回复

使用道具 举报

26

主题

1495

帖子

20

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 08:21:20 | 显示全部楼层
I would advise to look into the variations of (get...) calls  along wih ( initget )  .  It makes life so much easier.  -David
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 10:18 , Processed in 0.794487 second(s), 69 queries .

© 2020-2025 乐筑天下

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