明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1002|回复: 3

[求助]请高手们告诉我这是为什么

[复制链接]
发表于 2009-5-8 17:41:00 | 显示全部楼层 |阅读模式

今天我第一次尝试编写循环语句,出现了这样的一个问题

(defun c:test ()
  (setq pa (getpoint "n\ 输入楼梯的基点:"))
  (setq hh (getint "n\ 输入楼梯的每节高度:"))
  (setq ww (getint "n\ 输入楼梯每节宽度:"))
  (setq n (getint "n\ 输入阶梯数:"))
  (setq pb (polar pa (/ pi 2) hh))
  (setq pc (polar pb 0 ww))
  (command "line" pa pb pc "")
  (setq pp pc)
  (repeat (- n 1)
    (setq p1 (polar pp (/ pi 2) hh))
    (setq p2 (polar p1 0 ww))
    (command "line" pp p1 p2 "")
    (setq pp p2)
  )
  (princ)
)

这个程序测试没问题

但是我改了其中的三个句子后不能运行改程序

(setq pa (getreal "n\ 输入楼梯的基点:"))
  (setq hh (getreal "n\ 输入楼梯的每节高度:"))
  (setq ww (getreal "n\ 输入楼梯每节宽度:"))

请教高手这是为什么?

发表于 2009-5-8 18:24:00 | 显示全部楼层
(setq pa (getreal "n\ 输入楼梯的基点:"))
这句不能改,pa 为点,是表
 楼主| 发表于 2009-6-9 10:13:00 | 显示全部楼层

为什么?

 楼主| 发表于 2009-6-9 10:27:00 | 显示全部楼层
哦 看出来了 晕死 这么低级的错误
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-1 05:30 , Processed in 0.159973 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表