乐筑天下

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

[编程交流] AutoLISP find & replace based

[复制链接]

78

主题

207

帖子

129

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
395
发表于 2022-7-5 16:30:48 | 显示全部楼层 |阅读模式
can you point me in the right direction.
 
I want to write a lisp that will access an external .csv file and Find text in the first column and replace with text in the 2nd column.
 
This is my task
 
I have about 300 glass panels that have been numbed 100, 101, 103, 104 etc.  I need to renumber every piece to 300, 301, 303, 304 etc.  I don't think I can do this with the OTB find/replace.  I can easily create this list in excel and export to csv.  
 
Is there anything out there already that may be close that I can rework?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 17:05:32 | 显示全部楼层
Use this following these instructions.
回复

使用道具 举报

5

主题

1074

帖子

1088

银币

初来乍到

Rank: 1

铜币
9
发表于 2022-7-5 17:23:55 | 显示全部楼层
 
When in doubt check Lee Mac out.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:35:35 | 显示全部楼层
If the text is only a number then you can use a simple lisp method of just adjusting the current value ie +200 to all text picked.
 
  1. ; Adds or subtract a fixed amount to a number; By Alan H 2015(Alert "TO USE JUST TYPE A2LM")(DEFUN c:A2LM ( / el en a v1 v2 ss)(setvar "cmdecho" 1)(setq olddimzin (getvar "Dimzin"))(setvar "dimzin" 0)(if (not AH:getval) (load "getval"))(ah:getval "Enter ht adjust.." 10 (setq v2 (Atof item))(setq ss (ssget (list (cons 0 "Text"))))(setq len (sslength ss))(setq x 0)(repeat len(setq en1 (ssname ss x))       (setq el1 (entget en1))       (setq v1 (atof (cdr (assoc 1 el1))))       (setq a (+ v1 v2))       (setq b (rtos a 2 3))       (setq el (subst (cons 1 b) (assoc 1 el1) el1))       (entmod el)(setq x (+ x 1))) ; repeat(setvar "cmdecho" 1)(setvar "dimzin" olddimzin)(princ)); END DEFUN
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-3 16:41 , Processed in 0.784346 second(s), 61 queries .

© 2020-2025 乐筑天下

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