明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: 168a

[提问] 请问怎么从小到大的修改圆?

[复制链接]
 楼主| 发表于 2017-11-15 17:59 来自手机 | 显示全部楼层
高手们呢               
发表于 2017-11-15 20:50 | 显示全部楼层
  1. (defun c:bcnc ( / li et clst cenlist l2 EN ENT ENT1 I J NEWD R1 SS SS1 )
  2.         (if (and(setq ss (ssget "x"(list '(0 . "CIRCLE")(cons 8 "1")))) )
  3.                 (progn
  4.                         (setq i 0 clst nil  l2 nil)
  5.                         (repeat (sslength ss)
  6.                                 (setq en (ssname ss i)
  7.                                         ent (entget en)
  8.                                         r1 (assoc 40 ent)
  9.                                         cenlist (cons(cdr r1) cenlist)
  10.                                         i (1+ i))
  11.                                 (setq cenlist (vl-sort cenlist '< ))
  12.                         )
  13.                         (setq l2 (cons (car cenlist)l2))
  14.                         (while(setq cenlist (vl-remove(car cenlist)(cdr cenlist)))(setq l2 (cons(car cenlist) l2)))
  15.                         (foreach e (reverse l2)
  16.                                 (if (not (member e clst))
  17.                                         (progn
  18.                                                 (setq ss1 (ssget "x"(list(cons 8 "1") '(0 . "CIRCLE")(cons 40 e))))
  19.                                                 (setq newd (getdist (strcat "\n直径-->" (rtos (* e 2) 2 4) "<--:")))
  20.                                                 (if newd (progn
  21.                                                                                          (setq j 0)
  22.                                                                                          (setq e (/ newd 2))
  23.                                                                                          (setq clst (cons e clst))
  24.                                                                                          (repeat (sslength ss1)
  25.                                                                                                  (setq ent1 (entget(ssname ss1 j))
  26.                                                                                                          ent1 (subst (cons 40 e) (assoc 40 ent1) ent1)
  27.                                                                                                          j (1+ j))
  28.                                                                                                  (entmod ent1)
  29.                                                                                          )
  30.                                                                                  )
  31.                                                 )
  32.                                         )
  33.                                 )
  34.                         )
  35.                 )
  36.         )
  37.         (princ)
  38. )

评分

参与人数 1明经币 +1 金钱 +20 收起 理由
168a + 1 + 20 赞一个!

查看全部评分

 楼主| 发表于 2017-11-15 21:54 来自手机 | 显示全部楼层
只能修改两个,循环不了,谢谢
 楼主| 发表于 2017-11-15 22:11 来自手机 | 显示全部楼层
比如有1.0和1.1和1.2,修改加大0.1,试试看,有错误,谢谢
 楼主| 发表于 2017-11-15 22:12 来自手机 | 显示全部楼层
可以了,谢谢,设置好了就可以了
发表于 2017-11-19 20:17 | 显示全部楼层
院长的代码值得学习
 楼主| 发表于 2017-11-21 09:44 | 显示全部楼层
jun353835273 发表于 2017-11-19 20:17
院长的代码值得学习

嗯,但要加载一个工具,其实用不到太多,所以
不过还是谢谢院长的帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-3 19:05 , Processed in 0.223840 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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