明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 443|回复: 2

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

[复制链接]
发表于 2022-5-25 13:57 | 显示全部楼层 |阅读模式
在浩辰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

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2022-5-26 14:42 | 显示全部楼层
调试呀,看问题出在哪里? 十年前都混迹论坛了,没任何进步?
发表于 2022-7-2 06:32 来自手机 | 显示全部楼层
真心话,用浩辰就不要用二次开发程序。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-27 04:18 , Processed in 0.221731 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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