user: How do I use GreasePencilv3Layers(bpy_struct) in Blender? Include parameters, examples, warnings and best practices.

assistant: # GreasePencilv3Layers(bpy_struct)

base class — [`bpy_struct`](bpy.types.bpy_struct.html#bpy.types.bpy_struct "bpy.types.bpy_struct")

*class* bpy.types.GreasePencilv3Layers(*bpy_struct*)
:   Collection of Grease Pencil layers

    active
    :   Active Grease Pencil layer

        Type:
        :   [`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer")

    new(*name*, *\**, *set_active=True*, *layer_group=None*)
    :   Add a new Grease Pencil layer

        Parameters:
        :   - **name** (*string**,* *(**never None**)*) – Name, Name of the layer
            - **set_active** (*boolean**,* *(**optional**)*) – Set Active, Set the newly created layer as the active layer
            - **layer_group** ([`GreasePencilLayerGroup`](bpy.types.GreasePencilLayerGroup.html#bpy.types.GreasePencilLayerGroup "bpy.types.GreasePencilLayerGroup"), (optional)) – The layer group the new layer will be created in (use None for the main stack)

        Returns:
        :   The newly created layer

        Return type:
        :   [`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer")

    remove(*layer*)
    :   Remove a Grease Pencil layer

        Parameters:
        :   **layer** ([`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer"), (never None)) – The layer to remove

    move(*layer*, *type*)
    :   Move a Grease Pencil layer in the layer group or main stack

        Parameters:
        :   - **layer** ([`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer"), (never None)) – The layer to move
            - **type** (enum in [`'DOWN'`, `'UP'`]) – Direction of movement

    move_top(*layer*)
    :   Move a Grease Pencil layer to the top of the layer group or main stack

        Parameters:
        :   **layer** ([`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer"), (never None)) – The layer to move

    move_bottom(*layer*)
    :   Move a Grease Pencil layer to the bottom of the layer group or main stack

        Parameters:
        :   **layer** ([`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer"), (never None)) – The layer to move

    move_to_layer_group(*layer*, *layer_group*)
    :   Move a Grease Pencil layer into a layer group

        Parameters:
        :   - **layer** ([`GreasePencilLayer`](bpy.types.GreasePencilLayer.html#bpy.types.GreasePencilLayer "bpy.types.GreasePencilLayer"), (never None)) – The layer to move
            - **layer_group** ([`GreasePencilLayerGroup`](bpy.types.GreasePencilLayerGroup.html#bpy.types.GreasePencilLayerGroup "bpy.types.GreasePencilLayerGroup")) – The layer group the layer will be moved into (use None for the main stack)

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   type