明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1114|回复: 4

请求帮助

[复制链接]
发表于 2005-3-2 22:18 | 显示全部楼层 |阅读模式
我输入了一个简单程序,如下,运行后,提示“函数类型错误”,我检查了几遍检查不出来,程序是画一个键槽: defun c:jiancao(/ a b p0 r x0 xe ye ce p1 p2 p3)
(setq a (getreal "a=:"))
(setq b (getreal "b=:"))
(setq p0 (getpoint "enter stare point :"))
(set r (getreal "r=:"))
(setq x0 (car p0) y0 (cadr p0))
(setq xe (- x0 (/ a 2.0)))
(setq ye (+ y0 (sqrt (- (* r r) (* a a 0.25))
)
)
)
(setq ce (list xe ye))
(setq p1 (list (- x0 a) y0))
(setq p2 (list (-x0 a) (- y0 b)))
(setq p3 (list x0 (- y0 b)))
(command "pline" p0 "a" "ce" ce p1 "l" p2 p3 "c")
)
发表于 2005-3-2 23:46 | 显示全部楼层
  1. (defun c:jiancao(/ a b p0 r x0 xe ye ce p1 p2 p3)
  2.    (setq a (getreal "a=:"))
  3.    (setq b (getreal "b=:"))
  4.    (setq p0 (getpoint "enter stare point :"))
  5.    (setq r (getreal "r=:"))
  6.    (setq x0 (car p0) y0 (cadr p0))
  7.    (setq xe (- x0 (/ a 2.0)))
  8.    (setq ye (+ y0 (sqrt (- (* r r) (* a a 0.25))
  9.                  )
  10.              )
  11.   )
  12.   (setq ce (list xe ye))
  13.   (setq p1 (list (- x0 a) y0))
  14.   (setq p2 (list (- x0 a) (- y0 b)))
  15.   (setq p3 (list x0 (- y0 b)))
  16.   (command "pline" p0 "a" "ce" ce p1 "l" p2 p3 "c")
  17. )
 楼主| 发表于 2005-3-2 23:54 | 显示全部楼层
ZZXXQQ:how are you .


我看不出来错误何在?
发表于 2005-3-3 00:13 | 显示全部楼层
原程序第五行(set r (getreal "r="))


应改为(setq r (getreal "r="));setq少写了字母q。


原程序第十四行(setq p2 (list (-x0 a) (- y0 b)))应改为


(setq p2 (list (- x0 a) (- y0 b)));减号与x0之间要用空格。
 楼主| 发表于 2005-3-3 12:44 | 显示全部楼层
ZZXXQQ:How are you.


ok! thanks.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-7-1 14:57 , Processed in 0.152557 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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