ellen finkelstein logo

Ellen Finkelstein.com
AutoCAD PowerPoint About Links
       

Over 165 AutoCAD tips and tutorials!

AutoCAD Tips
AutoCAD Tips Blog

Get a free dynamic block tutorial and free AutoCAD tips!


RSS: What is it? Why do I want it? How do I get it?

Add to My Yahoo!
Subscribe with Bloglines

Buy a Book

E-mail This Page 
to a Friend

Submit a tip! If you include your name and I post your tip, I'll give you credit.

AutoCAD Tips & Tutorials

Switch between Imperial and metric measurements

If you usually draw using Imperial measurements (feet and inches), you may sometimes want to enter a length in metric units. For example, if you're designing a house in the United States, you may have certain items that were imported from Europe and are measured in millimeters or centimeters. It might be easier to be able to enter the metric measurements but calculating the conversion can be time-consuming.

Of course, the opposite is possible. If you are drawing using metric measurements, you may need to enter a length in Imperial units. Here are a couple of AutoLISP programs, one that converts Imperial to metric (inches to millimeters) and one that converts metric to Imperial (millimeters to inches). You can use these routines whenever you need to enter a length, generally with the LINE command.

You can change these routines to make other conversions, of course.

Convert metric to Imperial

(defun m2i (len ang /)
(strcat "@" (rtos (* len (/ 0.03937 1))) "<" (rtos ang))
)

This routine (m2i means metric to Imperial) multiplies any length by 0.03937 because there are 0.03937 inches in a millimeter. So if you use a length of 100 millimeters, you'll get 3.937 inches.

Convert Imperial to metric

(defun i2m (len ang /)
(strcat "@" (rtos (* len (/ 25.4 1))) "<" (rtos ang))
)

This routine (i2m means Imperial to metric) multiplies any length by 25.4, because there are 25.4 millimeters in an inch. So if you use a length of 3 inches, you'll get 76.2.

How to use these routines

To load these routines, you can put them in acaddoc.lsp (which you may need to create). Make sure acaddoc.lsp is in your support file search path. Any routines in this file are automatically loaded each time you open a new drawing.

These routines have two parameters, len (length) and ang (angle). You use them at the Specify next point or [Undo]: prompt, in parentheses, adding the length and angle that you want for the line segment, as shown in this example:

(m2i 25 0)

Immediately afterwards, you see the results of the routine, so you can check that you're getting the result you want, as shown here:

"@0.9843<0.0000"

So you're command line would look like this:

Command: _line Specify first point:
Specify next point or [Undo]: (m2i 25 0)
"@0.9843<0.0000"

Specify next point or [Undo]:

You can then continue to specify other line segments.

I want to thank Darren Young (www.mcwi.com)  for the original AutoLISP code,  which I've changed slightly, and expanded upon.

More Tips

101 Tips

Page copy protected against web site content infringement by Copyscape


Books by Ellen

New!
AutoCAD 2009 and AutoCAD LT 2009 Bible

This is the 9th edition of this book! Completely updated to conform to the new interface and, of course, it covers all the new features, such as the ribbon, Quick View, ShowMotion, the View Cube, the SteeringWheel, and more.

AutoCAD 2008 and AutoCAD LT 2008 Bible
Learn the great new features with wide application to all disciplines. Get the most comprehensive book on AutoCAD! DVD contains a 30-day trial of AutoCAD and AutoCAD LT. Thorough exercises guide you through each feature.

AutoCAD 2007 and AutoCAD LT 2007 Bible 
Discover the 2007 features, especially the radically improved 3D tools. CD has AutoCAD 30-day trial, 3rd-party software, and drawings for exercises.

AutoCAD 2006 and AutoCAD LT 2006 Bible 
Understand and use the 2006 features, including dynamic blocks and the new method of customizing menus and toolbars. CD-ROM has AutoCAD trial, software, and drawings for all exercises.


AutoCAD 2005 and AutoCAD LT 2005 Bible
Fully explains latest 2005 features:  tables, fields, and sheet sets. For the first time, covers AutoCAD LT! CD-ROM comes with software and drawings for all exercises.


AutoCAD 2004 Bible

Covers all features in detail. Hands-on exercises. Over 1300 pages + CD-ROM with software and drawings for all exercises.

                                  Home  |  AutoCAD  |  PowerPoint  | E-StoreAbout  | Links | Contact | Site Map
Copyright Ellen Finkelstein, Inc.