Is there a way or a script that can be wrote to convert ALL text (attributed, embedded in blocks, etc.) to a different style? Instead of using BATMAN
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Would it suffice to change all Style definitions to use the same font [and perhaps also other characteristics like obliquing angle and width factor, possibly even height], rather than change all text-variety objects to the same Style? You would still have multiple Styles defined, but they would all look the same. For example, we have this available:
(defun C:ASA9 (/ cmde sty); = All Styles Arial font at 0.9 width factor
(setq cmde (getvar 'cmdecho))
(setvar 'cmdecho 0)
(while (setq sty (cdr (assoc 2 (tblnext "style" (not sty)))))
(if (not (wcmatch sty "*|*")); not in an Xref
(command "_.style" sty "Arial" "" 0.9 "" "" "")
); if
); while
(setvar 'cmdecho cmde)
(princ)
); defun
(prompt "\nType ASA9 to set All Styles to Arial font at 0.9 width factor.")
Kent, this may actually work. I tried it and it converted every piece of text to Arial in my drawing. To give you a small idea of what I am trying to do: I have hundreds of drawings that were unfortunately drawn under the Romans.shx font and have Romans style. None of these drawings have readable text when using Adobe/Bluebeam. I am in the process of converting them over to readable text. So I'm not so much worried about the style per say as I am about getting the whole drawing into readable text format. This way, the users then can search a database and their search results would pull up whatever drawing had that particular search word in it. To keep it all coherent, I would love to have both style and font changed but I understand if you can't do that. I'm looking for a "STANDARD" style with 0.75 width factor and RomanS_IV25 font.
[I assume you are aware that changing the font will affect things like word wrapping in Mtext, whether Dimension text fits between extension lines, etc. So it should be followed by a careful look-over to check for things that may need adjustment.]
One potential complication with changing all Text and Text-like objects to the same Style, rather than just all Styles to the same font: Do you ever use Styles with fixed height? If you use different heights at all, of course any "universal" Style would need to be defined at "zero" height to accommodate that variety. So anything in Styles that had a fixed height will lose that characteristic, if that matters to you.
Ya I was looking at some of those issues and I believe I will be fortunate enough to have bypassed those. The script you provided does everything I need it to do (of course with a few tweeks to the code to my liking). Thank Kent! I appreciate your support yet again.
Kent, you were right. Some of the drawings are being modified through the script but it is negatively affecting certain characters within my drawings. Can the script be changed so that it would perform this execution: Change all font to RomanS_IV25 with a width factor of 0.75, HOWEVER, if the drawing contains this criteria,
Text Style: LType
Font Name: Arial Narrow
Font Style: Bold
Width Factor: 1.00
DO NOT convert it. Simply ignore this text and keep it at Arial Narrow.
Here is the lsp I am currently running:
(defun C:r25 (/ cmde sty); = All Styles RomanS_IV25 font at 0.75 width factor
(setq cmde (getvar 'cmdecho))
(setvar 'cmdecho 0)
(while (setq sty (cdr (assoc 2 (tblnext "style" (not sty)))))
(if (not (wcmatch sty "*|*")); not in an Xref
(command "_.style" sty "RomanS_IV25" "" 0.75 "" "" "")
); if
); while
(setvar 'cmdecho cmde)
(princ)
); defun
(prompt "\nType ASA9 to set All Styles to RomanS_IV25 font at 0.75 width factor.")
Can't find what you're looking for? Ask the community or share your knowledge.