Tuesday, July 25, 2006

Using a Field to Display the Viewport Scale

You can insert a Field and link it to a Viewport object to display, and automatically update, the Viewport's Zoom Scale Factor.

Insert a Block with Attributes, or just create a piece of Text. Edit the Attribute. Right-click the value and choose insert Field.

In the Field dialog (below), set your Field category to Objects, Set Field names to Object, and click the Select Object Button. Select the Viewport. You'll be returned to the Field dialog; choose Custom scale from the Property column, and choose the desired Format. The Preview area will show the results. Clicking OK will update the Attribute.

In this case we see that my Viewport Zoom Scale Factor is 31/256" = 1'-0" which is close but incorrect. Rescaling the Viewport to 1/8" = 1'-0" and Regenerating the drawing updates the Field.

Now you can see at a glance, whether on the screen or on a plot, whether the Viewport scale is correct.

Tuesday, July 18, 2006

In AutoCAD 2006 and up, Tab means AutoComplete.

Do you have trouble remembering those arcane AutoCAD commands or system variables? Do you hate typing in those long command names?

Type the first few letters of the command or system variable desired and press the TAB key. AutoCAD cycles through all the commands that start with those letters with each press of the TAB key. When you get to the one you want, press Enter.

The more letters you enter initially, the fewer matches AutoCAD will need to cycle through.

Bonus: If you overshoot the desired command, use Shift+TAB to back up.

Tuesday, July 11, 2006

Field Variables

There are two important variables that affect AutoCAD Fields.

FIELDDISPLAY determines whether Fields display the gray background that distinguishes them from other Text. This background is a visual cue only and does not plot. This variable can be 0 (Off) or 1 (On), and is stored in the Registry (i.e. set it once and it is set in all drawings).

FIELDEVAL controls how Fields are updated. This variable is stored in the drawing, and has the following values:

0 - Not updated
1 - Updated on Open
2 - Updated on Save
4 - Updated on Plot
8 - Updated on eTransmit
16 - Updated on Regen

The default value for this variable is 31 which updates on all events, (this is from adding up all the possible event integers: 1+2+4+8+16=31). If you have a drawing with many Fields and it takes a significant amount of time to update, set FIELDEVAL to 15 to turn "off" update on Regen, but still update Fields on all other events. Or you may have a drawing where Fields are not updating as you expect; check the value of FIELDEVAL.

Bonus: Use Lisp to create shortcuts to toggle or set these variables quickly.

(defun c:fd () (setvar "FIELDDISPLAY" (abs (1- (getvar "FIELDDISPLAY")))))

; reset FIELDEVAL to update on all events
(defun c:fe () (setvar "FIELDEVAL" 31))

Monday, July 03, 2006

Using Unicode

You can insert a number of special symbols into Mtext. In the Mtext editor select the symbol icon "@" on the formatting toolbar to get the symbols menu.

But what if you want to insert a symbol not in this list? There are a number of characters in most fonts that can be inserted with some good old fashioned arcane syntax. Notice all the \U+xxxx codes on the menu? Those are the Unicode values for the symbol.

Let's say you wanted to use the less than or equal to symbol. It's not available from AutoCAD's list of symbols, but it is defined in the ROMANS text font. It's Unicode value is \U+2264. How does one find this value? Use the Windows Character Map (Start > All Programs > Accessories > System Tools > Character Map).

In Character Map select the True Type equivalent of the AutoCAD font you're using in your drawing. Locate the desired symbol from the font; it's Unicode value is displayed in the lower left corner of the dialog.

In the Mtext Editor type this Unicode value where you wish to insert the symbol. The special symbol will appear immediately.