明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1883|回复: 1

各位,小弟请教AUTOLISP程序问题

[复制链接]
发表于 2002-7-24 22:01 | 显示全部楼层 |阅读模式
下面是小弟写的一段AUTOLISP程序,在AutoCAD里执行,总是返回NIL,小弟百思不得其解,望指教
(defun C:dd()
   (setq enta1 (entnext))
   (setq ent-list1 (entget enta1))
   (while enta1
     (if(and (= (cdr (assoc 8 ent-list1)) "zm") (= (cdr (assoc 0 ent-list1)) "LINE"))
       (progn
         (setq p1 (cdr (assoc 10 ent-list1)))
         (setq x1 (fix (car p1)))
         (setq enta2 (entnext enta1))
         (setq ent-list2 (entget enta2))
         (setq p2 (cdr (assoc 10 ent-list2)))
         (setq x2 (fix (car p2)))
         (setq d (- x2 x1))
         (setq x (/ (+ x1 x2) 2))
         (setq d (* d 5))
         (command "text" "C" (list (+ x 20) 21) 0 d)
       )     
     )
     (setq enta1 enta2)
     (setq ent-list1 ent-list2)  
  )
)
发表于 2002-7-24 22:15 | 显示全部楼层

程序的最后一个括号前写上(princ)

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

本版积分规则

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

GMT+8, 2024-7-7 01:58 , Processed in 0.192217 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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