明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1200|回复: 3

[提问] 批量更新圆的属性

[复制链接]
发表于 2014-6-22 12:47:31 | 显示全部楼层 |阅读模式
(defun c:aa()
   (setq d1 (getpoint "输入第一点"))
   (setq d2 (getpoint "输入第二点"))
   (setq xj1 (ssget "w" d1 d2);为什么只需要(setq ss(ssget)),难道默认是框选?
   (setq xj2 (ssget "x" (list(cons 0 "cricle"))))
   (setq a 0)
   (setq cs (sslength xj1))
   (setq xsx (cons 40 2000)) ;不需要是(list (cons))了
(repeat (cs)
   (setq b (ssname xj2 a))
   (setq c (entget b))
   (setq d (assoc 40 c))
   (setq c (subst xsx d c))
   (entmod c)
   (setq a (1+ a));不是(+ 1 a)
  )
  )
不知道哪里问题呢??

点评

cricle → circle  发表于 2014-6-22 12:58
发表于 2014-6-22 13:04:43 | 显示全部楼层
  1. (defun c:tt ()
  2.   (if (and (setq d1 (getpoint "输入第一点: "))
  3.            (setq d2 (getcorner d1 "输入第二点: "))
  4.            (setq ss (ssget "w" d1 d2 '((0 . "circle"))))
  5.       )
  6.     (progn
  7.       (setq a  0
  8.             rr '(40 . 2000)
  9.       )
  10.       (repeat (sslength ss)
  11.         (setq c (entget (ssname ss a))
  12.               c (subst rr (assoc 40 c) c)
  13.               a (1+ a)
  14.         )
  15.         (entmod c)
  16.       )
  17.     )
  18.   )
  19.   (princ)
  20. )
发表于 2014-6-22 13:09:35 | 显示全部楼层
找老猫去,训练下
发表于 2014-6-22 13:15:17 | 显示全部楼层
;; 简码
  1. (defun c:tt ()
  2.   (if (setq ss (ssget '((0 . "circle"))))
  3.     (xyp-SubUpd ss 40 2000)
  4.   )
  5.   (princ)
  6. )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-24 13:45 , Processed in 0.181845 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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