乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 104|回复: 2

[编程交流] Copy Number + .01

[复制链接]

2

主题

15

帖子

16

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-6 17:20:32 | 显示全部楼层 |阅读模式
I am coming across a situation at work (which will last for a period of time) where we are creating a numerical grid. I created the proto with a default grid, and the same number copied throughout (#1.11-0.00). The thing killing me is having to edit each one, one at a time. Can be time consuming when there are a few hundred. A while back, someone helped out with a match text lisp for a different situation, which is somewhat helpfull in this situation. Also one which will copy a number, then place the second below it adding .01 .  I can match one row, then only edit one digit at a time for each sequence. Still takes a long time.
 
I was wondering if between the two, a lisp could be created to match the text then instead of replacing the text exactly, add .01 to the number. Such as if I have a row, I edit the first number, use a command, then select the first, and after, every number I select will go up .01 ( #123.11-0.00 , #123.12-0.00, #123.13-0.00, ect..). Or if it would just be easier to create a new one from scratch.
 
If anyone could point me in the right direction, or at least help me get started, it would be very much appretiated
回复

使用道具 举报

0

主题

252

帖子

290

银币

限制会员

铜币
-8
发表于 2022-7-6 18:10:50 | 显示全部楼层
I have this as VBA if you want it
  1. Public Sub TextNumber()     Dim objSelected As Object     Dim blnFlag As Boolean     Dim intCnt As Integer     Dim strValue As String     Dim objTxt As AcadText     Dim objSelSet As AcadSelectionSet     On Error GoTo ErrControl     Set objSelSet = ThisDrawing.SelectionSets.Add("Text")     objSelSet.SelectOnScreen     intCnt = 1     For Each objSelected In objSelSet           If TypeOf objSelected Is AcadText Then                 Set objTxt = objSelected                 If blnFlag = False Then      'This is the first entity selected                       objTxt.TextString = intCnt                       blnFlag = True                 Else                       objTxt.TextString = intCnt                 End If                 intCnt = intCnt + 1           Else                 MsgBox "Object number " & intCnt & " is not DText, you need to reselect", vbInformation, "Gap Set"                 ThisDrawing.SelectionSets.Item("Text").Delete           End If     Next     ThisDrawing.SelectionSets.Item("Text").Delete     ThisDrawing.Application.UpdateExit_Here:     Exit SubErrControl:     MsgBox Err.DescriptionEnd Sub
回复

使用道具 举报

2

主题

439

帖子

536

银币

限制会员

铜币
-14
发表于 2022-7-6 18:39:43 | 显示全部楼层
This http://www.asmitools.com/Files/Lisps/Num.html or http://www.asmitools.com/Files/Lisps/Renum.html will ok.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 16:27 , Processed in 0.406048 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表