本帖最后由 free-freak 于 2022-8-6 17:17 编辑
 - (defun c:ttt ()
- (vl-load-com)
- (setq int (getint "输入删除字符的个数"))
- (setq i -1)
- (if (setq ss (ssget '((0 . "text"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq s1list (vl-string->list (xyp-DXF 1 s1)))
- (setq n 0)
- (setq j 0.0)
- (while (< j int)
- (if (> (nth n s1list) 127)
- (setq j (+ j 0.5))
- (setq j (1+ j))
- )
- (setq n (1+ n))
- )
- (if (> (strlen (xyp-DXF 1 s1)) n)
- (xyp-SubUpd s1 1 (substr (xyp-DXF 1 s1) (1+ n)))
- )
- )
- )
- (princ)
- )
- (defun xyp-SubUpd (ename code newvalue)
- (entmod (subst (cons code newvalue)
- (assoc code (entget ename))
- (entget ename)
- )
- )
- (entupd ename)
- )
- (defun xyp-dxf (code e)
- (cdr (assoc code (entget e)))
- )
根据 e派 大神的源码整理修改,增加了判断统计特殊字符部分,新手学习,望多指正 |