明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2831|回复: 7

求高手帮忙改变。阵列+文本递增。

  [复制链接]
发表于 2012-4-16 12:56:18 | 显示全部楼层 |阅读模式
弄了好久还是很多问题。
求高手帮忙。
希望结果:1.选择多个对象同时阵列。 2.可以让文本里面的其他数据留下。我这里递增后只剩下数字了。

代码现状:
(defun c:arn( / ent temp d a number yorn)
(setq cmdmode (getvar "cmdecho"))  
(setvar "cmdecho" 0)  
;选择一个实体,并判断能否作为生成递增数的初始数。
(setq ent (entsel "\nSelect number to arn: "))
(if (null ent)
(progn
(princ "\nError: Nothing selected!\n")
(exit)
)
)
(setq temp (entget (car ent)))
(if (= (cdr (assoc 0 temp)) "TEXT")
;输入生成递增数的个数、数间距及其方向。
(progn
(setq number(getint "Number of texts:"))
(setq d(getdist "Dist between texts:"))
(setq a (atoi(cdr(assoc 1 temp))))
(initget 1 "V H")
(setq yorn (getkword " Direction(V/H)?"))  
(if (= yorn "V")
(setq p (list 0 d))
)  
(if (= yorn "H")
(setq p (list d 0))
)
;重复拷贝前一个数,并将拷贝数加1。
(while (/= number 1)
(command "copy" ent "" p "")
(setq ent (entlast))
(setq temp (entget ent))
(setq a (+ a 1))
(entmod (subst (cons 1 (itoa a))
(assoc 1 temp) temp))
(setq number (1- number))
)
)
)
(setvar "CMDECHO" cmdmode)
)  
(princ "\n\tc:arn loaded. Start command with arn.")

 楼主| 发表于 2012-4-16 13:40:47 | 显示全部楼层
求高手呀!!!!
发表于 2012-4-16 13:49:38 | 显示全部楼层
能否图文说明
发表于 2012-4-17 09:10:05 | 显示全部楼层
纯支持!!!!!!!
发表于 2012-9-24 16:23:58 | 显示全部楼层
路过 打酱油
发表于 2014-10-10 16:41:49 | 显示全部楼层
顶楼主,想找一个沿弧线自动阵列的程序
发表于 2016-5-22 17:04:36 | 显示全部楼层
找到了吗,我也在找
发表于 2019-6-14 00:06:00 来自手机 | 显示全部楼层
思路不错,楼主找到了没有
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-18 20:15 , Processed in 0.152614 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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