Is there a lisp or shortcut to convert a multiple line mtext to a single line mtext?
Your help is greatly appreciated.
Thank you.
Craig II <><
|
Is there a lisp or shortcut to convert a multiple line mtext to a single line mtext?
Your help is greatly appreciated.
Thank you.
Craig II <><
Thank you for your reply.
I don't know why I didn't think of it earlier, explode and convert back to mtext.
Easy as that.
Take Care.
Yes the above answer is ok if you do not have any fields in text, but how to do that with mtext containing fields so the fields stay fields?!
Extract the string (assoc 1 (entget <ename>)) and put it back, then explode.
Code:this.Mode = Modes.ProfessorChaos;Code:(defun c:FOO (/ ss oldEnt eData asso eName) (if (setq ss (ssget ":S:E:L" '((0 . "MTEXT")))) (progn (setq oldEnt (entlast)) (entmod (subst (cons 1 (cdr (setq asso (assoc 1 (setq eData (entget (ssname ss 0))))) ) ) asso eData ) ) (command "._explode" ss) (setq eName oldEnt) (while (and (setq eName (entnext eName)) (= "TEXT" (cdr (assoc 0 (entget eName)))) ) (command "txt2mtxt" eName "") ) (setq eName oldEnt) (while (setq eName (entnext eName)) (entmod (subst (cons 41 (* 0.0 (cdr (setq asso (assoc 41 (setq eData (entget eName))) ) ) ) ) asso eData ) ) ) ) ) (princ) )
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
... Just demonstrating, which regretfully doesn't do this:
... And I didn't know that:
... So, cheers... You know, for that.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000