明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1808|回复: 1

[原创] 对比较乱的座标式标注进行对齐式标注

[复制链接]
发表于 2004-3-17 21:49:00 | 显示全部楼层 |阅读模式
对比较乱的座标式标注进行对齐式标注,但只执行了一次循环,后面的不能执行,请各位多指教. (defun c:p_dim()
(setvar "cmdecho" 0)
(setq old_la (getvar "clayer"))
(setvar "clayer" "尺寸线层")
(prompt "\n选择基准尺寸")
(setq ent1 (entsel))
(while (= nil ent1)
(prompt "\n选择基准尺寸")
(setq ent1 (entsel))
)
(setq en1 (entget (car ent1)))
(setq uc1 (trans (cdr (assoc 10 en1))0 1))
(command "ucs" "o" uc1)
(setq po1 (trans (cdr (assoc 13 en1)) 0 1))
(setq po2 (trans (cdr (assoc 14 en1)) 0 1))
(prompt "\n选择更新尺寸")
(setq i 0)
(setq ent2 (ssget '((0 . "DIMENSION"))))
(while (= nil ent2)
(prompt "\n选择更新尺寸")
(setq ent2 (ssget '((0 . "DIMENSION"))))
)
(repeat (sslength ent2)
(progn
(setq en2 (entget (ssname ent2 i)))
(setq uc2 (trans (cdr (assoc 10 en2)) 0 1))
(setq e3 (trans (cdr (assoc 13 en2)) 0 1))
(setq e4 (trans (cdr (assoc 14 en2)) 0 1))
(command "erase" ent1 "")
(command "erase" ent2 "")
(command "DIMORDINATE" po1 po2)
(command "DIMCONTINUE" e3 "" "")
)
(setq i (1+ i))
)
(setvar "clayer" old_la)
(princ)
)
发表于 2004-3-18 08:20:00 | 显示全部楼层
(repeat (sslength ent2)
(progn
(setq en2 (entget (ssname ent2 i)))
(setq uc2 (trans (cdr (assoc 10 en2)) 0 1))
(setq e3 (trans (cdr (assoc 13 en2)) 0 1))
(setq e4 (trans (cdr (assoc 14 en2)) 0 1))
(command "DIMORDINATE" po1 po2)
(command "DIMCONTINUE" e3 "" "")
)
(setq i (1+ i))
)
(command "erase" ent1 "");move
(command "erase" ent2 "");move
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-27 21:07 , Processed in 0.156244 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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