Table Cell Text String Different From String Displayed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
After running the LISP below (I forgot where I found it, so if it's yours, I apologize), the old string that has been replaced remains in the updated table cell and properties, but the string displayed in the updated table cell displays the new string. So, when modifying or selecting the table cell, it shows/returns the old string.
I'm just trying to save the displayed text string as a variable for now.
(defun replacestr (Obj new old / str)
(foreach Property '(TextString TextOverride)
(and
(vlax-property-available-p Obj Property)
(setq str (vlax-get Obj Property))
(while (vl-string-search old str) ;;<- look for string
(setq str (vl-string-subst new old str )) ;;<-replace here
(vlax-put Obj Property str)
)
)
)
)
(defun replaceall (new old)
(vlax-for n
(vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)))
(vlax-for m n
(if (and (= "AcDbBlockReference" (vla-get-objectname m))
(= :vlax-true (vla-get-hasattributes m)))
(foreach att (vlax-invoke m 'getattributes)
(replacestr att new old)
)
(replacestr m new old)
)
)
)
)
Displayed Text: 84100299
Actual Text String: $CABLE
A nudge as to how/why this is happening would be greatly appreciated.
AutoCad 2018 (full)
Win 11 Pro
Win 11 Pro