Tip 2221: Copy Objects to Layer Theodorus Winata wrote Copy Objects to Layer, which does two things at once -- and with a nice style, too. The tip contains a dialog box file (DCL) as well as the LISP source code, so place the DCL file somewhere in the normal AutoCAD search path. After loading the LISP code, type Cpl at the Command prompt to activate the command. A dialog box appears, displaying a list of the current layers in the drawing. Select one of the layer names or the button to pick from an object in the drawing. When ready, select OK to continue to the copy portion of the command function. Select objects to be copied in the normal manner inside AutoCAD. Next, pick the base point and the displacement point. The objects will be copied, and the layer value changed to the layer name that you selected in the dialog box at the start of the command. This tip is a nicely coded example of how to manipulate the layer table, use a custom dialog box, and work the AutoCAD commands. A tip of the hat to Theodorus. |