• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

new automatic layer with progressive number

  • Thread starter Thread starter lorenzo94
  • Start date Start date

lorenzo94

Guest
Hello, everyone. can you create a routine that, when creating a layer, builds one with the same characteristics but with an increase in the number and change of color?
example: creo layer n°1002, with blue color, and automatically a layer with name 1003 is generated but with different color.
I hope I've been clear, thank you! :cool:
 
Hello, Lorenzo.
try this ruoutine:

1. stream the layer to duplicate by increasing the name, with the properties set according to your needs.
the name of the layer must be composed of an alphanumeric part and a numerical part separated by the character "_".
example: mylayer01_1
upload the lisp, give the n+l command and you will find a new layer with the increased numerical part, a new color generated randomly,
but with the exclusion of colors too dark, and with all properties inherited from the layer that was current at the time of execution.
the new layer is automatically made current to allow repeated use of the routine.

greetings, young people

ps. tested on autocad 2012
 

Attachments

I made a change...
if the name of the layer does not already have the character "_" and the number,
is added automatically "_1"
 

Attachments

ok thanks, I saw that even if I call only "_1" the layer he automatically generates _2, and I needed this. Thank you.
 
but you want me to make you a version that works with the name of the numerical layer (1002.. 1003 ... 1004) as in the example you had done?
 
if the layer name is a number, it increases and creates a new layer
if the layer name is a string, add "_n" and create a new layer
if the layer name is a string that already contains "_n" does "n+1)

if the name of the layer already exists nn nothing happens, only that changes its color.. .
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top