Here's one I use. It doesn't require an insertion point, but it makes anonymous blocks, which may not be what you want because they do not show in Autocad's Block Editor.
Steve
- ;;; MAKES ANONYMOUS BLOCKS;;;(princ "\n This code is provided Unscramnbled - for free - given that it is not altered")(princ "\n Thanks for your understanding, www.xordesign.com ")(princ "\n Type TBLOCK to start ")(defun c:TBLOCK (/ sset tell ent ent_get entu ent_getu blk) (princ "\n Select objects to group into anonymous Block: ") (setq sset (ssget)) (if sset (progn (entmake (list '(0 . "BLOCK") '(2 . "*U") '(70 . 1) '(10 0.0 0.0 0.0))) (setq tell 0) (setq ent (ssname sset tell)) (while ent (setq ent_get (entget ent)) (if (/= (cdr (assoc 0 ent_get)) "POLYLINE") (progn (setq ent_getu (cdr ent_get)) (entdel ent) (entmake ent_getu)) (progn (setq entu ent ent_getu (cdr ent_get)) (while (/= (cdr (assoc 0 ent_getu)) "SEQEND") (setq ent_getu (cdr (entget entu))) (entmake ent_getu) (setq entu (entnext entu)) );while (entdel ent) ) );if (setq tell (+ tell 1)) (setq ent (ssname sset tell)) ) (setq blk (entmake (list '(0 . "ENDBLK")))) (entmake (list '(0 . "INSERT") (cons 2 blk) '(10 0.0 0.0 0.0))) );progn );if (princ "\n Anonymous block created. Explode to ungroup") (princ)) (princ)
|