I'm trying to replace the %%C with a Ø symbol. The symbol came from mtext with the %%C exploded. The exploded version is working when brought into Revit, but the %%C does not. I have a routine that works when I copy it from within notepad and paste it into the command line. When I load it from the lsp file and run it, I get Ø insted. Here is what I'm using to change the %%C to Ø:
(defun PH_FIX2 (old new / regex)
(setq regex (vlax-get-or-create-object "VBScript.RegExp"))
(vlax-put-property regex 'global actrue)
(vlax-put-property regex 'ignorecase actrue)
(vlax-put-property regex 'multiline actrue)
(vlax-put-property regex 'pattern old)
;;process every block
(vlax-for n (vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(vlax-for m n
(if (member (vla-get-objectname m) '("AcDbMtext" "AcDbText" "AcDbMLeader" ))
(vla-put-textstring
m
(vlax-invoke
regex
'replace
(vla-get-textstring m)
new
))))))
(PH_FIX2 "%%C" "Ø")