明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1250|回复: 3

[LISP]这个程序为什么总出错?

[复制链接]
发表于 2005-11-10 11:12 | 显示全部楼层 |阅读模式

这是别人的程序,可我在运行时总出错,真不知道该怎样解决?

(defun c:ttpts (/ f ff a lst ilst nlst)

  (if (and (setq f (getfiled "pts.txt" "" "" 4))   ;(指定路径,文件名)

    (setq ilst (getstring T "\n输入点序列(1起算,以空格分开):")) ;; "2 4 6 1 9"

    )

    (progn

      (setq ff (open (findfile f) "r"))

      (while (setq a (read-line ff))

 (setq lst (cons (cdr (read (strcat "(" a ")"))) lst))

      )

      (close ff)

      (setq lst (reverse lst)

     nlst(mapcar '(lambda(x)(nth (1+ x)lst)) (read (strcat "(" ilst ")")))

     )

      (apply 'command (cons "pline" nlst))

      (command "")

    )

  )

)

比如说:当我输入点号1 2 4 6 8时,它就会连接2 4 8 2或者其他的局部连线;有些时候我就是输入再多的点号它干脆就不连线了!!!!

真是急死人了!!!!!

 楼主| 发表于 2005-11-10 11:22 | 显示全部楼层

不好意思!该帖子发重了!!!

发表于 2005-11-10 12:52 | 显示全部楼层

pts.txt文件中数据有没有错哦?

发表于 2005-11-10 14:52 | 显示全部楼层
nlst(mapcar '(lambda(x)(nth (- x 1)lst)) (read (strcat "(" ilst ")")))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-20 07:03 , Processed in 0.157666 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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