明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1458|回复: 5

新手求教!!

[复制链接]
发表于 2012-5-2 14:53 | 显示全部楼层 |阅读模式
我想框选一个区域,并只选择该区域内的圆,其他的都不选!!然后要求修改圆的直径。改怎么弄啊!!
发表于 2012-5-2 15:02 | 显示全部楼层
发表于 2012-5-2 16:09 | 显示全部楼层
给你写个吧,反正也很简单,代码如下:
  1. (defun c:modidiam( / cir-num newdia cirall cir-name cir-name-vla)
  2.   (vl-load-com)
  3.   (setq cir-num 0)
  4.   (setq newdia (getreal"\n请输入修改后的直径:"))
  5.   (if (setq cirall (ssget '((0 . "circle"))))
  6.       (repeat (sslength cirall)
  7.          (setq cir-name (ssname cirall cir-num))
  8.          (setq cir-name-vla (vlax-ename->vla-object cir-name))
  9.          (vlax-put-property cir-name-vla 'diameter newdia);cirall
  10.          (setq cir-num (1+ cir-num))
  11.       )
  12.   )
  13.   (princ)
  14. )
  15.   (prompt "\n【程序运行命令:modidiam】")
发表于 2012-5-2 17:27 | 显示全部楼层
收藏~~~~~~~~~
发表于 2012-5-2 18:31 | 显示全部楼层
  1. ;改多圆、圆弧半径 作者:KAIXIN
  2. (defun c:XX ()
  3. (setq br (getreal "\n输入你想要的半径:"))
  4.   (prompt "\n请框选你要改变的圆: ")
  5.   (setq        ss (ssget '((0 . "CIRCLE,ARC")))
  6.         i   -1
  7.   )
  8.   (while (setq s1 (ssname ss (setq i (1+ i))))
  9.     (KX-SubUpd s1 40 br)
  10.   )
  11.   (princ)
  12. )

  13. (defun KX-SubUpd (ename code newvalue)

  14. (entmod (subst (cons code newvalue)
  15.    
  16. (assoc code (entget ename))
  17.    
  18. (entget ename)
  19.    )
  20.   )
  21. (entget ename)
  22. )
 楼主| 发表于 2012-5-3 07:14 | 显示全部楼层
谢谢,大家的帮助!,感觉明经的好人真多啊!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-4 05:48 , Processed in 0.228485 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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