CAD Forums > CAD General
Mtext with Space inbetween Characters
MSTG007:
I know this is an odd one. I am searching "possibly" without lisp where as Mtext is used, a extra space would go in between.
i.e.
THIS IS A TITLE to T H I S I S A T I T L E.
If not, is there a special type of font I could use?
thanks for the help!
CAB:
MAYBE THIS
--- Code: ---;; CAB 04/10/2006
;; Add space(s) to text strings between characters
;; Note that there are problems with format codes especially with mText.
(defun c:textspacer (/ spc ent txt obj spacetext)
(defun spacetext (txtstring spccnt / spaces newlst)
(repeat spccnt (setq spaces (cons 32 spaces)))
(foreach x (vl-string->list txtstring)
(setq newlst (append newlst (list x) spaces))
)
(vl-list->string newlst)
)
(initget 6)
(setq spc (getint "\nHow many spaces do you want to add? 1-5 <1> "))
(or spc (setq spc 1))
(if (> spc 5) (setq spc 5))
(while (setq ent (entsel "\nSelect Text to add spaces to."))
(setq txt (vla-get-textstring (setq obj (vlax-ename->vla-object (car ent)))))
(setq txt (spacetext txt spc))
(vla-put-textstring obj txt)
)
(princ)
)
--- End code ---
MSTG007:
LOL.... Thanks CAB... Funny thing is. That is what I have been using to get the job done! Another awesome routine of yours!
CAB:
Happy to remind you. 8)
MSTG007:
Did some more researching...
https://forums.autodesk.com/t5/autocad-2007-2008-2009/text-kerning/td-p/2731751
Text Kerning... Now I know what it does.
Navigation
[0] Message Index
[#] Next page
Go to full version