[Search tip detail and code files using keywords, tip number, author name, etc ]
Specify Offsets in Inches While Working with Feet
Tip# 3295 By Leland Leahy On 08-Nov-2009
Rated By 2 users
Categories : 2D Operations
Software type : AutoCAD 2010
Rename File To : No Files to download.
To use this macro, save the code (all one line) as a LISP routine, load it, and then type OI on the Command line.

Leland Leahy sends the following AutoCAD macro that will offset objects in inches — even when you are working in feet as your unit setting.

"This is useful for civil engineers who work with feet as a unit."


(defun C:OI(/ sz ofs)(setvar "cmdecho" 0)(setq sz (getreal" What is the offset in inches: ") ofs (/ sz 12.0))(setvar "OFFSETDIST" ofs)(command ".offset" "") (prin1))

Notes from Cadalyst Tip Patrol: This macro works just as promised. To use it, save the code (all one line) as a LISP routine, load it, and then type OI on the Command line. A prompt will ask you to enter the offset distance in inches. This routine assumes you are working in feet, so one unit in AutoCAD would be equal to 1 foot. In fact, you could enter all your offsets in inches, even if the distance is 3 feet. Just type in 36 for three feet and it will still work properly. To further simplify the process, you can enter your distance as the number of inches followed by /12. For example, if you need to offset by 3 inches, enter an offset distance of 3/12. AutoCAD will do the math for you and offset your object by 0.25 feet. 



Average Rating:

User comments
Comment by hammond,wade
Posted on 2009-11-09 16:43:23
I have been using the 'cal command for years (I am a surveyor working in feet/decimals) for example 14'2" = 'cal 14+2/12 or 9' 5-7/16" = 'cal 9+5/12+7/16/12 you dont need brackets because division is completed before addition
Comment by Duzan,Tim
Posted on 2009-11-10 09:23:39
I don't use inches, but this is a very nice lisp Leland.