明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 841|回复: 6

[提问] 自己写了一个小程序,循环有些问题麻烦老师们给予指导

[复制链接]
发表于 2019-8-14 19:33 | 显示全部楼层 |阅读模式
(defun c:qdl(/ name1 tz1 str1 name2 tz2 str2)  
(setq name1 (car (entsel "\n 具体内容N:")))
(setq tz1 (getstring "\n添加标题N: "))
(setq str1 (strcat  tz1 str (cdr (assoc 1 (setq ent (entget name1)))) ";"))
  (setq name2 T)
  ;;;;;;以下循环
     (while name2
        (setq name2 (car (entsel "\n 具体内容N+1:")))
;;;(setq tz2 (getstring "\n添加标题N+1: "))
          (if (null mame2)
            (progn
              (princ "程序结束")
              (exit)
            )
          )
       (setq tz2 (getstring "\n添加标题N+1: "))
(setq str2 (strcat  tz2 str (cdr (assoc 1 (setq ent (entget name2)))) ";"))
(setq str1 (strcat str1 str2 ) )   
       )
(entmake (list '(0 . "TEXT") (cons 1 (strcat  str1))  (cons 10 (getpoint "选择插入点"))
(cons 62 1) (cons 40 th) ))
(redraw)
(princ)
   (princ)
)

本帖子中包含更多资源

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

x
发表于 2019-8-14 22:17 | 显示全部楼层
本帖最后由 叮咚 于 2019-8-19 20:48 编辑


本帖子中包含更多资源

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

x
发表于 2019-8-14 22:40 | 显示全部楼层
                 试试

本帖子中包含更多资源

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

x
 楼主| 发表于 2019-8-14 23:22 | 显示全部楼层

谢谢,可以用啦
 楼主| 发表于 2019-8-14 23:22 | 显示全部楼层

谢谢您,可以用啦
发表于 2019-8-16 14:10 | 显示全部楼层
谢谢分享,楼主是好人
发表于 2019-8-19 20:48 | 显示全部楼层
yamjqq 发表于 2019-8-14 23:22
谢谢,可以用啦

更新了,试一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-29 17:44 , Processed in 0.171304 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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