只需一步,快速开始
使用道具 举报
(defun dxf(code elist) (cdr (assoc code elist)) ) ;查找与替换 (defun c:rep();/ ss txsize n index ent type oldsize newsize ent1 char) (setvar "CMDECHO" 0) (prompt "\n 请输入查找范围:") (setq ss (ssget)) (setq txsize (entget (car (entsel "请选择查找文字目标:")))) (setq txsize (dxf 1 txsize)) (prompt "\n 指定或输入替换内容?") (setq char (grread)) (cond ((= (car char) 3) (progn (setq ent (entget (ssname (ssget (cadr char)) 0))) (setq char (dxf 1 ent)) );progn );pick from screen ((= (car char) 2) (progn (princ (chr (cadr char))) (setq char (strcat (chr (cadr char)) (getstring))) );progn );pick form keyboard (t nil) ); (princ "\n") (princ "\n") (princ (strcat txsize "替换为-->" char "\n")) (setq n (getstring "确认替换吗?[Esc取消]:")) (setq n (sslength ss)) (setq index 0) (repeat n (setq ent (entget (ssname ss index))) (setq index (+ 1 index)) (setq type (assoc 1 ent)) (if (= txsize (cdr type)) (progn (setq oldsize (assoc 1 ent)) (setq newsize (cons (car oldsize) char)) (setq ent (subst newsize oldsize ent)) (entmod ent) );progn );if );repeat (prin1) )
返回
CAD/CAM 2 EaSy 2000
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2024-11-18 17:33 , Processed in 0.173836 second(s), 26 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.