need a lisp to split objects to layers

Hi, I need a lisp routine to split all objects in a selection set (all
are 3d Solids), each to a seperate layer.
1) need to get selection set
2) object 1 -> layer 1
3) object 2 -> layer 2
4) etc
I have a drawing with over 1200 solids in it and somehow managed to
merge all layers. I can rename the layers easy enough. but there are
too many object to do by hand
Reply to
Christopher A. Kelly
Loading thread data ...
Hi, I need a lisp routine to split all objects in a selection set (all are 3d Solids), each to a seperate layer.
1) need to get selection set 2) object 1 -> layer 1 3) object 2 -> layer 2 4) etc
I have a drawing with over 1200 solids in it and somehow managed to merge all layers. I can rename the layers easy enough. but there are too many object to do by hand
Reply to
Christopher A. Kelly
So you want to make a drawing with over 1200 layers? Really?
Reply to
Michael Bulatovich
Hi, I need a lisp routine to split all objects in a selection set (all are 3d Solids), each to a seperate layer.
1) need to get selection set 2) object 1 -> layer 1 3) object 2 -> layer 2 4) etc
I have a drawing with over 1200 solids in it and somehow managed to merge all layers. I can rename the layers easy enough. but there are too many objects to do by hand
Reply to
Christopher A. Kelly
Here is a *very* simple routine to do this:
(DEFUN C:OBJ2LAY(/ TOT ENTG LNAM X) (SETQ TOT (SSGET) X 0) (REPEAT (SSLENGTH TOT) (SETQ ENTG (ENTGET (SSNAME TOT X))) (SETQ LNAM (STRCAT "LAYER" (ITOA X))) (COMMAND ".LAYER" "M" LNAM "") (ENTMOD (SUBST (CONS 8 LNAM)(ASSOC 8 ENTG) ENTG)) (SETQ X (1+ X)) ) ) (PRINC "Type OBJ2LAY to start routine")
Reply to
LTravis
No, don't want one, but I need one. I is for a large entertainment center with shelves, drawers, cabinets, etc. and my employer uses a add-in to generate cut lists based on one object a layer
Reply to
Christopher A. Kelly
Thank you, worked like a charm.
Reply to
Christopher A. Kelly

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.