Automatic line layer assignment

How to make sure that every time you create a new line in Rhino, a new layer is automatically created and this line is assigned to this layer, for example "layer 01 (02; 03; 04 … etc.). And when the line is deleted , the layer on which the line was located was deleted? and display all this in grasshopper)

You will need to write a python or VB script or a c# plugin for Rhino that hooks to the following events. The new event handler you create would check if the object created is a line and then create a new layer.
On the deletion of an object, another event would execute that deletes the layer the object is on.

unfortunately i can’t code

You might be able to do something with human in grasshopper, but coding will be the most ideal solution.

tried with (human) and (Elefront) but so far to no avail

You can do this with Human if you get a little clever:

new layer for every new (11.0 KB)

This assumes that all the new lines you draw are on the “Default” layer — they get moved to a new layer named with their ID after you draw them. The “random color” script is not necessary to the functioning of this script.

1 Like

but how to make it so that the layer is automatically deleted when you delete a line?

Like this:

new layer for every new (14.1 KB)

1 Like