请注意jmerch,如果您打算使用我已经为您发布的任何例程,您应该修改
常规。。。。。。这就是。
- (defun c:Test (/ ss str)
- (if (and (setq ss (ssget "_X" '((0 . "MTEXT") (1 . "TEST")))) ; select mtext
- (/= "" (setq str (getstring T "\nSpecify string: "))) ; specify string & /= ""
- )
- (progn
- ;; below steps through active selectionset
- (vlax-for obj (setq ss (vla-get-activeselectionset ; active selectionset
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (vla-put-textstring obj str)
- )
- (vla-delete ss) ; delete selection set (not acutal objects, just the selection set)
- )
- )
- (princ)
- )
因为如果用户使用例程并按enter键而不是支持字符串,则例程会将找到的mtext替换为nil字符串(不可见)。
塔瓦特 |