Hello,
I was looking for a lisp that would take a selection set of blocks and move each block to their own individual layers while naming the new layer it creates by the block name. I tried searching for a lisp already but couldn't find one that did this.
Thanks
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
@zasanil wrote:
I was looking for a lisp that would take a selection set of blocks and move each block to their own individual layers while naming the new layer it creates by the block name.
Something like this perhaps.
Quick and dirty...
(defun c:demo (/ blk ent hnd i name ss) (if (setq ss (ssget ":L" '((0 . "INSERT")))) (repeat (setq i (sslength ss)) (setq hnd (ssname ss (setq i (1- i))) ent (entget hnd) blk (vlax-ename->vla-object hnd) name (vlax-get-property blk (if (vlax-property-available-p blk 'EffectiveName) 'EffectiveName 'Name ) ) ) (entmod (subst (cons 8 name) (assoc 8 ent) ent)) ) ) (princ) )
Hope that helps
Henrique
You didn't searched well...
http://www.theswamp.org/index.php?topic=47952.0
M.R.