Originally Posted by
dfuehrer
...I am looking for a lisp that selects all entities on a given layer, and then turns those entities into a block named xxxxx inserted at 0,0....
Code:
(defun c:BlockLayer (/ Ent Lay SelSet )
;; Copyright removed
(if (setq Ent (entsel "Select object on layer to convert to block : " ) )
(progn
(command "_.UNDO" "BEgin" )
(setq Lay (cdr (assoc 8 (entget (car Ent )))) )
(setq SelSet (ssget "_X" (list (cons 8 (cdr (assoc 8 (entget (car Ent )))) ))))
(command "._-block" "xxxxx" "0,0,0" SelSet "" )
(command "._-insert" "xxxxx" "0,0,0" "" "" "" )
(command "._change" "l" "" "p" "la" Lay "" )
(command "_.UNDO" "End" )
)
(princ "...nothing selected" )
)
(princ)
)
: ) Happy Computing !
kennet