wimal 发表于 2022-7-5 13:22:15

添加到字符串

该代码可以找到一些文本并将其他一些文本替换为字符串。
但是我怎样才能在字符串的前面或末尾添加新文本呢。

mr-blue 发表于 2022-7-5 14:09:41

您需要用strcat替换vl string subst
 
因此,要附加到现有字符串的末尾,代码如下所示:

(setq e(entget entNotation))
      (setq st (cdr (assoc 1 e)) )
      (entmod (subst (cons 1 (strcat (cdr (assoc 1 e)) replace44))
                     (assoc 1 e) e))

satishrajdev 发表于 2022-7-5 14:32:14

试试这个,如果不想添加任何新字符串,只需将N设置为“”。
2
页: [1]
查看完整版本: 添加到字符串