Here is a handy routine that will let you quickly create a block of selected objects – it will even automatically name the block for you.
- QB <enter> to start (Quick Block)
- Select the objects that you want the block to be made of <enter>
- Specify an Insertion point
- The routine will automatically give the block a generic name “MyBlock” followed by a number. Each time you use the routine to create a quick block, the number will increase incrementally (ex. MyBlock1, MyBlock2, MyBlock3…)
- Note – Use on blocks that do not have attributes – use on geometry only
; Quick Block ; Creates a block instantly out of the objects that you select ; Found at http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Quick-block/td-p/3454228 (defun c:QB (/ selectionset insertionpoint number Blockname) ;;; Tharwat 11. May. 2012 ;; (if (and (setq selectionset (ssget "_:L")) (setq insertionpoint (getpoint "\n Specify insertion point :")) ) (progn (setq number 1 Blockname (strcat "MyBlock" (itoa number)) ) (while (tblsearch "BLOCK" Blockname) (setq Blockname (strcat "MyBlock" (itoa (setq number (1+ number)))) ) ) (command "_.-Block" Blockname insertionpoint selectionset "") (command "_.-insert" Blockname insertionpoint "" "" "") ) (princ) ) (princ) )