Author |
Topic |
|
vidar_78
Starting Member
Norway
2 Posts |
Posted - March 13 2008 : 07:42:09 AM
|
Hi,
Is there a way to change the text style on a drawing (from roman.shx to tahoma.shx) easily with Hurricane? I have about 200 drawings that needs a change in text style.... and I don't want to do it manually |
|
Admin
Administrator
652 Posts |
Posted - March 13 2008 : 08:48:58 AM
|
Hi vidar,
Yes, you can use the CHTEXT.LSP ("CHT") to do that. The script goes something like this...
Lisp file can be found here... http://www.74mph.com/forum/topic.asp?TOPIC_ID=50 (You can load it manually, or have it autoload each time you start AutoCAD or the script, that's another topic )
;BEGIN SCRIPT
CHT
;Select objects: all
ALL
;Select objects:
;Carriage return to tell it you are done
;Height/Justification/Location/Rotation/Style/Text/Undo/Width: s
S
;Individual/List/Select style/<New style name for all text entities>:
;Just a carriage return for ALL
;New style name for all text entities:
THE_NEW_STYLE
;Height/Justification/Location/Rotation/Style/Text/Undo/Width:
;just a carriage return to exit the command
;Command: regen
REGEN
;END SCRIPT |
Hurricane for AutoCAD http://www.74mph.com FAQ at http://www.74mph.com/faq/faq.html Tutorials at http://www.74mph.com/tutorials.html |
|
|
vidar_78
Starting Member
Norway
2 Posts |
Posted - March 14 2008 : 07:59:23 AM
|
quote: Originally posted by Admin
Hi vidar,
Yes, you can use the CHTEXT.LSP ("CHT") to do that. The script goes something like this...
Lisp file can be found here... http://www.74mph.com/forum/topic.asp?TOPIC_ID=50 (You can load it manually, or have it autoload each time you start AutoCAD or the script, that's another topic )
;BEGIN SCRIPT
CHT
;Select objects: all
ALL
;Select objects:
;Carriage return to tell it you are done
;Height/Justification/Location/Rotation/Style/Text/Undo/Width: s
S
;Individual/List/Select style/<New style name for all text entities>:
;Just a carriage return for ALL
;New style name for all text entities:
THE_NEW_STYLE
;Height/Justification/Location/Rotation/Style/Text/Undo/Width:
;just a carriage return to exit the command
;Command: regen
REGEN
;END SCRIPT
Hi there, thanks for the answer.... but this doesn't solve my problem, I was not specific enough in my first post I guess.
I have a set of drawings which are made for the font "Tahoma" (Style = Standard). Some where along the road these drawings have been saved with font "Romans" (Style = still Standard), and the text in blocks does not fit in its frame anymore. Not only textboxes, but also text in blocks.
I would like Hurricane to open drawing - Tools - Text Style - Change Font to Tahoma (on style Standard), set width to 1.0, regen, save and close drawing.
Is this possible?
Regards
Vidar
|
|
|
Admin
Administrator
652 Posts |
Posted - March 14 2008 : 09:07:02 AM
|
Hi Vidar,
YES, as long as it can be done at the AutoCAD command line, then Hurricane can 'repeat' it over your drawings.
Use the "-STYLE" command, and walk through the prompts manually in AutoCAD, type EVERY answer out, just do the same in Hurricane, or Copy/paste the AutoCAD F2 window contents, into the "Tools->Capture AutoCAD Commands to Script" feature, and have it make the script for you. http://www.74mph.com/faq/FAQ00089.html
Here are what the prompts look like... modify to suit.
;BEGIN SCRIPT
;Command: -STYLE
-STYLE
;Enter name of text style or [? ] <Current>:
;Specify full font name or font filename (TTF or SHX) <GOTHIC.TTF>:
;Specify height of text <0.0000>:
;Specify width factor <1.0000>: .5
.5
;Specify obliquing angle <0>:
;Display text backwards? [Yes/No] <N>:
;Display text upside-down? [Yes/No] <N>:
;Command: regen
REGEN
;END SCRIPT |
Hurricane for AutoCAD http://www.74mph.com FAQ at http://www.74mph.com/faq/faq.html Tutorials at http://www.74mph.com/tutorials.html |
|
|
n/a
deleted
112 Posts |
Posted - March 14 2008 : 09:22:18 AM
|
Vidar,
I have attached a file which contains a couple of completely untested lisp routines that may do what you need. Before trying them, back up all of your drawings to a separate folder in case the lisp raises "havoc".
You will have to rename the file with a ".LSP" extension rather than the ".TXT" extension. (The forum doesn't like ".LSP".) Place the file in your AutoCAD search path or in the same folder as your drawings.
Your script file should contain the following lines: (load "switch2tahoma") SWFONTSTAHOMA SWBT2T
The 2nd line of the script is intended to take care of everything but text in blocks. The 3rd line of the script should take care of the text in blocks. I have adapted the lisps from some that I have used previously, though, and I don't remember exactly what they are capable of.
I'm pretty well swamped today. If what I attached doesn't work, I'm not sure I will have a chance to do any more with the problem today, but let me know how it goes. If you have time to wait until Monday, I may have some time over the weekend to look into it further.
Bill, will the forum handle a DWG attachment? If the lisp doesn't work as is, could Vidar upload a drawing that I could run some test runs on?
Download Attachment: Switch2Tahoma.TXT 1.73 KB |
Steve Bubendorf
|
|
|
Admin
Administrator
652 Posts |
|
n/a
deleted
112 Posts |
Posted - March 14 2008 : 09:37:50 AM
|
So Vidar should be able to zip a DWG file and post it, if he would like me to do some trial runs? |
Steve Bubendorf
|
|
|
Admin
Administrator
652 Posts |
|
|
Topic |
|