yamjqq 发表于 2019-8-14 19:33:26

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

(defun c:qdl(/ name1 tz1 str1 name2 tz2 str2)
(setq name1 (car (entsel "\n 具体内容N:")))
(setq tz1 (getstring "\n添加标题N: "))
(setq str1 (strcattz1 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 (strcattz2 str (cdr (assoc 1 (setq ent (entget name2)))) ";"))
(setq str1 (strcat str1 str2 ) )   
       )
(entmake (list '(0 . "TEXT") (cons 1 (strcatstr1))(cons 10 (getpoint "选择插入点"))
(cons 62 1) (cons 40 th) ))
(redraw)
(princ)
   (princ)
)

叮咚 发表于 2019-8-14 22:17:19

本帖最后由 叮咚 于 2019-8-19 20:48 编辑


start4444 发表于 2019-8-14 22:40:53

               试试

yamjqq 发表于 2019-8-14 23:22:13

叮咚 发表于 2019-8-14 22:17


谢谢,可以用啦

yamjqq 发表于 2019-8-14 23:22:47

start4444 发表于 2019-8-14 22:40
试试

谢谢您,可以用啦

13916020908 发表于 2019-8-16 14:10:42

谢谢分享,楼主是好人

叮咚 发表于 2019-8-19 20:48:54

yamjqq 发表于 2019-8-14 23:22
谢谢,可以用啦

更新了,试一下
页: [1]
查看完整版本: 自己写了一个小程序,循环有些问题麻烦老师们给予指导