# Sort by Layers

![](/files/eBkwDlQKb4HVk6HDJCBE)

![](/files/tFBvQvEN8VuzZkqG2QLQ) - [\[source code\]](https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src//LB%20Sort%20by%20Layers.py)

Sort and group Rhino objects by layers. Please find the source code from: <https://github.com/ladybug-tools/ladybug-grasshopper-dotnet>

### Inputs

* **K**

A list of Rhino objects that associated with sortable layers

* **A**

Optional object list to sort synchronously

### Outputs

* **K**

Sorted objects by layers

* **A**

Synchronously sorted objects

* **n**

Grouped layer names


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ladybug.tools/ladybug-primer/components/4_extra/sort_by_layers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
