669423907 发表于 2022-5-25 13:57:40

一段标注代码,在浩辰2020里只能运行一部分

在浩辰2020里只能生成一个标注,路过的大师,请问要怎么改,才可以在浩辰2020里顺利运行呢?

(defun c:tt()
(jd_bz nil nil)
(princ))


;基点标注
(defun jd_bz(p1 p2 / *error* x)
(defun *error*(msg)(setq p1 nil p2 nil)(princ))
(setq x (entlast))
(if (and p1 p2)
(progn
(princ "\n 请指定尺寸线位置或输入值:")
(command "dimlinear" "non" p1 "non" p2 "\\")
)
(if (setq p1 (getpoint "\n 请指定基点标注第一点:"))
(setq p2 (cadr(grread 3)) )
(progn
(command "dimlinear" "" "\\" "\\" "")
(if (and (new_en x) ;判断是否有新图元
(setq p1 (getpoint "\n 请指定基点标注第一点:")) ) (setq p2 (cadr(grread 3))) )
) ) )
(while (not (new_pt p2) ) ;判断pt是否为最后点
(if (setq p2 (getpoint p1"\n 请指定基点标注下一点:") )
(if (not (new_pt p2) )
(progn
(princ "\n 请指定尺寸线位置或输入值:")
(command "dimlinear" "non" p1 "non" p2 "\\")
) ) ) )
(setq p1 nil p2 nil)
(princ))


(defun new_en(i)(if (equal i (entlast)) nil t)) ;(setq x (entlast)) (if (new_en x) ) ;判断是否有新图元


(defun new_pt(pt)(if (=(distance(getvar"lastpoint")pt)0)t)) ;判断pt点是否最后点 new_pt

jltx123456 发表于 2022-5-26 14:42:08

调试呀,看问题出在哪里? 十年前都混迹论坛了,没任何进步?

gzcsun 发表于 2022-7-2 06:32:34

真心话,用浩辰就不要用二次开发程序。
页: [1]
查看完整版本: 一段标注代码,在浩辰2020里只能运行一部分