CAD LISP语言求助,以下程序只能识别前缀为1个汉字,大神能帮忙改成可识别2个汉字的?后续2

(if(=re_call1)(selecttxt_gzl)));;;选出"HYA"、"GYT"、"GYF"文字数(defunselecttxt_dlcs()(setqtx... (if (= re_call 1) (selecttxt_gzl))
)

;;;选出"HYA"、"GYT"、"GYF"文字数
(defun selecttxt_dlcs()
(setq txt_l (strlen txt0))
(if (> txt_l 3)
(if (or (= (substr txt0 1 3) "HYA") (= (substr txt0 1 3) "GYT") (= (substr txt0 1 3) "GYF"))
(ssadd temp nsset2))
)
)

;;;工作量与电缆程式对号
(defun gzl_duihao()
(setq duihao_ls1 nil)
(setq duihao_ls2 nil)
(setq nsset1_len (sslength nsset1))
(while (> nsset1_len 0)
(setq duihao_yes 0)
(setq nsset1_temp (ssname nsset1 (setq nsset1_len (1- nsset1_len))))
(setq nsset1_rd (cdr (assoc 50 (entget nsset1_temp))))
(setq nsset1_pt (cdr (assoc 10 (entget nsset1_temp))))
(setq nsset1_pt (list (car nsset1_pt) (cadr nsset1_pt)))
(setq nsset2_len (sslength nsset2))
(while (> nsset2_len 0)
(setq nsset2_temp (ssname nsset2 (setq nsset2_len (1- nsset2_len))))
(setq nsset2_rd (cdr (assoc 50 (entget nsset2_temp))))
(if (or (< (abs (- nsset1_rd nsset2_rd)) 0.1) (> (abs (- nsset1_rd nsset2_rd)) 6.2))
(progn
(setq nsset2_pt (cdr (assoc 10 (entget nsset2_temp))))
(setq nsset2_pt (list (car nsset2_pt) (cadr nsset2_pt)))
(setq dis_n1n2 (distance nsset1_pt nsset2_pt))
(if (< dis_n1n2 12) ;指定插入点间距范围
(progn
(setq n1n2_rd (- (angle nsset2_pt nsset1_pt) nsset1_rd))
(setq dis_yn1n2 (abs (* dis_n1n2 (sin n1n2_rd))))
(if (and (< dis_yn1n2 5) (>= n1n2_rd 0) (<= n1n2_rd Pi))
(progn
(setq duihao_yes 1)
(setq nsset2_temp1 nsset2_temp))
(if (and (< dis_yn1n2 5) (= duihao_yes 0))
(progn
(setq duihao_yes 1)
(setq nsset2_temp1 nsset2_temp))
))
))
)
)
)
(if (= duihao_yes 0)
(progn
(setq duihao_lstemp nil)
(setq duihao_lstemp (cdr (assoc 1 (entget nsset1_temp))))
(setq duihao_ls2 (cons duihao_lstemp duihao_ls2))
))
(if (= duihao_yes 1)
(progn
(setq duihao_lstemp nil)
(setq duihao_lstemp (cons (cdr (assoc 1 (entget nsset2_temp1))) (cdr (assoc 1 (entget nsset1_temp)))))
(setq duihao_ls1 (cons duihao_lstemp duihao_ls1))
(ssdel nsset2_temp1 nsset2)
))
)
)

;归类
展开
 我来答
半途中888
2018-07-03 · TA获得超过837个赞
知道小有建树答主
回答量:463
采纳率:81%
帮助的人:127万
展开全部
以上代码写的太烂,不如提要求重新写。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式