Jump to content

Altering the same text styles in 80 drawings!!


Recommended Posts

Posted

is there a quick way to do this at all guys?

 

I have 10 buildings as xrefs, most buildings average 5 floors, with 2 drawings per floor.

 

these have come to me with varying inconsistencies, so I'm trying to match them all up.

 

there's 5 text styles that all need to be Arial as end client can't read original font types.

 

so is there a quick command/lisp that allows me to open up every drawing if needed, press a button and it changes ALL text styles to Arial?

 

if not, apart from the obvious of opening up each drawing "ST" then altering each one, how else can this be done quickly??

 

cheers again

 

Chris

Posted

And that's why they call it AutoCAD and not CAD_Magic. There is no "press a button and it changes" option. That's the bad news.

 

The good news is you can probably accomplish the task using a script file that would open each drawing, in turn, make the appropriate changes, save and close the drawing.

Posted

Remember that in writing your script you want it to work basically automatic so use the version of the command that does NOT produce dialog windows. Everything must be done at the command line level. So the STYLE command is invoked thusly: -style and NOT Style. To familiarize yourself with the prompts AutoCAD will display, and get a sense for the answers you'll have to supply, try it out in a drawing where you have two or more text styles changing one to the other. It should go without saying but...don't save the drawing after this little exercise.

 

If you do an Internet search on the word and phrase shown below it might help. Use it exactly as written (with quotes and plus sign).

 

"autocad"+"how to write a script file"

Posted

cheers fella, alas i knew there woudln't be a "press a button" however i lived in hope, and you squashed my dream! lol

 

nah thanks for that, I'm a very basic 2D CAD monkey, probably use about 10% max of it's true capabilities so writing scripts etc and knowing all the commands is way above my head.

 

but i'll look in the script writing and get it done.

 

cheers

Posted

Another *wrong* way to do this would be to replace your font files. Back everything up first, but if you just overwrote all of your font files with Ariel, then AutoCAD would display everything as Ariel.

 

If you're just doing this for a one-time, need-to-plot-with-new-fonts-yesterday, and nobody else will be using your DWGs, then it might be the quickest (although dirtiest) way to make the change.

Posted

First the disclaimer. I did not write the code below. I found it at the AutoDesk Discussion Groups forum. All credit goes to Jason Piercey. First published Nov. 7th, 2007.

 

In a question similar to yours Jason wrote...

 

Try this

 

(vl-load-com)

 

(defun c:updateTextstyles (/ new)

(setq new (strcat (getenv "systemroot") "\\Fonts\\Arial.ttf"))

(vlax-map-collection

(vla-get-textstyles

(vla-get-activedocument

(vlax-get-acad-object)))

'(lambda (x / font)

(setq font (strcase (vla-get-fontfile x)))

(if (wcmatch font "ROMANS.SHX,SIMPLEX.SHX,TXT.SHX")

(vla-put-fontfile x new)))

)

(princ)

)

 

--

Autodesk Discussion Group Facilitator

 

* * * * * * * * * * * *

 

OK. Where you see the font Arial.ttf you want to substitute the font you want to change to.

 

Where you see Romans.shx, Simplex.shx, Txt.shx you want to substitute the names of the five fonts you want changed.

 

Got it?

 

In its present form it can only be used on one drawing at a time. I'm not 100% sure if this routine can be called from within a script to batch process a group of files.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...