明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1325|回复: 2

這樣的lisp問題出在那

[复制链接]
发表于 2006-11-20 15:42 | 显示全部楼层 |阅读模式

5

(defun c:5test3 ()
  (setq a1 (getpoint "\n输入插入点:"))
  (setq w1 (getreal "\n输入w1长:"))
         (setq w2 (getreal "\n输入w2长:"))
         (setq a  (getreal "\n输入a长角度:"))
         (setq b  (getreal "\n输入b长:"))  
         (setq d (getreal "\n输入d长:"))  
   (setq pt1 (polar a1 (* 1.5 pi)(* 0.5 b )))
   (setq pt2 (polar pt1 0 w2))
   (setq pt3 (polar pt2 0 b))
   (setq pt4 (polar pt3 pi w2))
   (setq n   (/ (w1 (cos a)))
   (setq n1  (sqrt(-(*n  n)(*w1 w1))))
   (setq pt5 (polar pt4 (* 0.5 pi)n1))
   (setq pt6 (polar pt5 (*(- 90 a)(/180 pi)n)))
   (setq pt7 (polar pt6 (*1.5 pi) d))
   (setq pt8 (polar pt1 (*1.5 pi) n1))
 (command "line" pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8"c")
(prin1)
)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2006-11-20 20:11 | 显示全部楼层
关闭捕捉。你可以用LISP编辑器调试一下。
发表于 2006-11-20 22:11 | 显示全部楼层

粗略地看了一下,问题还是比较多的.

1.(/ (w1 (cos a)))应该为(/ w1 (cos a));

2.诸如此类*(- 90 a)(/180 pi)n)))都不符合语法格式:

应改为* (- 90 a) (/ 180 pi) n),该有的空格绝对不能省;

3. 这一句polar pt5 (*(- 90 a)(/180 pi)n))

少了参数,应改为polar pt5 (* (- 90 a) (/ 180 pi)) n);

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

本版积分规则

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

GMT+8, 2024-5-12 04:56 , Processed in 0.134104 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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