[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Create a 'Half Offset' Macro
Tip# 3267 By Ed Galicki On 20-Sep-2009
4
Rated By 1 users
Categories : Programmer's Tools
Software type : AutoCAD 2010
Rename File To : No Files to download.
This command will offset an object half of the entered distance.

Ed Galicki sends us a macro for the Offset command that will offset an object half of the entered distance.

 

"This macro is similar to the tip about using CAL in commands. I still use a tablet, but a toolbar item could also do the same thing. I have a box on my menu titled Half Offset. It has the following macro:

 

^C^C^POFFSET;(SETQ DHLF (/ (GETDIST "DISTANCE TO OFFSET HALF OF ? ") 2)) ^P

 

"I create lots of shafts, bars, etc. This makes it quick to get the command I want for making a shaft. The line that is to be offset must exist, but no other material is necessary. Click the command, then pick the distance that will be automatically divided in half, and type in a number or pick points. The routine asks for the line to be offset; do it in both directions."

 
Notes from Cadalyst Tip Patrol: Macros are a great efficiency tool, especially when you use a command a particular way all the time. They are easy to create and easy to use. Open the CUI and go to the Command List area. Click the Create a New Command Icon (a star) to open a window on the right. There you will assign an Icon and the macro features. Most start with ^C^C, which emulates the Escape key being hit twice. Make sure that you are not inside a command already, then type in a command. A space or semicolon (;) will act like the Enter key. I suggest you use the semicolon. If there are any options to enter for the command, simply put the desired options into your macro just as you would if you were entering them on the keyboard during the command, substituting a semicolon for Enter. You can also use system variables, diesel commands, and a bit of LISP coding (as seen in this tip), but that's a bit much for this format. Look at the commands that came with AutoCAD, especially the circle commands, to get an idea of some of the things you can do with macros. They can really help you out. Once created, you can add them to toolbars, menus, the ribbon, and even tool palettes — you decide. 

 

 

Average Rating:
4


User comments
Comment by White,David
Posted on 2009-09-21 15:27:31
Check out my HO.LSP half offset routine also. Offset to Center David White sends us a routine that he uses to offset objects centered on an object. "I really call this file HO.LSP, but for storage I call it HO_ORG.LSP as I use in other ro... Read more Tip#: 3216Author: David WhiteRename File To: ho_org.lsp,__MACOSX/,__MACOSX/._ho_org.lspPublished on: 14-Jun-2009Downloads: 210Rating: 0


Log In