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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
So you want to make a drawing with over 1200 layers? Really?
--


MichaelB
www.michaelbulatovich.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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")

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Thank you, worked like a charm. "LTravis" <lt> wrote in message

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.