请帮看下问题出在哪,怎么改
本帖最后由 cds15980954301 于 2024-5-24 22:43 编辑请大家帮看下,以下函数哪里有问题,时灵时不灵的-
关闭捕捉的情况下
问题1、有时标注会没放到位
问题2、有时会提示选择圆标注
(DEFUN C:qwe( / sel n sellpc p10 p11)
(setq sel (ssget ":N" '((0 . "CIRCLE"))));选择圆
(if(not sel)(exit));如果没有就退出
(setq sell nil)
(setq n -1)
(repeat (sslength sel);
(setq n (+ 1 n))
(setq sell (cons (list(assoc 40(entget(ssname sel n))) (ssname sel n)) sell)))
(setq aa (guibingsell))
(foreach x aa (zhibiao x))
)
(defun zhibiao ( lis / pc p10 p11)
(setq pc(cdr(assoc 10 (entget(cadr lis)))));圆中心
(setq p10(polar pc pi (cdaar lis)));圆上点
(setq p11(polar pc (*0.15 pi)(* 3 (cdaar lis))));标注放置点
(command "DIMDIAMETER" p10 "T" (strcat (rtos(cdar lis)) "-" "<>") p11)
)
;程序guibing来源 ll_j http://bbs.mjtd.com/forum.php?mod=viewthread&tid=107370&highlight=%CD%BC%D4%AA&_dsign=081f1d0f
(defun guibing (lst / tmp)
(if lst
(cons(cons (cons (caar lst)(length (setq tmp (vl-remove-if-not'(lambda (x)(equal (car x) (caar lst)))lst))))
(apply 'append (mapcar 'cdr tmp)) )
(guibing (vl-remove-if'(lambda (x)(equal (car x) (caar lst)) )lst))))
)
(command "DIMDIAMETER" p10 "T" (strcat (rtos(cdar lis)) "-" "<>") p11)
目测应该是commad的捕捉问题。 Bao_lai 发表于 2024-5-24 22:28
(command "DIMDIAMETER" p10 "T" (strcat (rtos(cdar lis)) "-" "") p11)
目测应该是commad的捕捉问题。
有试着把捕捉关掉,但还是一样 改一下这句 (command "DIMDIAMETER" "non"(list (cadr lis) p10) "T" (strcat (rtos(cdar lis)) "-" "<>") "non"p11) start4444 发表于 2024-5-25 01:14
改一下这句 (command "DIMDIAMETER" "non"(list (cadr lis) p10) "T" (strcat (rtos(cdar lis)) "-" "")...
谢谢,第二个问题解决了,但第一个问题还在
页:
[1]