need a lisp to split objects to layers

Aug 11, 2004 6 Replies

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


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

So you want to make a drawing with over 1200 layers? Really?

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

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")

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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required