TheSwamp
CAD Forums => CAD General => Topic started by: MSTG007 on February 20, 2017, 10:50:02 AM
-
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!
-
MAYBE THIS
;; 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)
)
-
LOL.... Thanks CAB... Funny thing is. That is what I have been using to get the job done! Another awesome routine of yours!
-
Happy to remind you. 8)
-
Did some more researching...
https://forums.autodesk.com/t5/autocad-2007-2008-2009/text-kerning/td-p/2731751 (https://forums.autodesk.com/t5/autocad-2007-2008-2009/text-kerning/td-p/2731751)
Text Kerning... Now I know what it does.
-
Why don't you just set the spacing in the editor?
-
I think that was genius.... :uglystupid2: Thank you!
-
Why don't you just set the spacing in the editor?
This is the way to go. When you finally switch over to TrueType fonts they will be correctly searchable vs the hard coded space between each letter.