How to import the cad and analysis the layer(Grasshopper)

Hello, when I try to import CAD files into Grasshopper and analyze the layers, for example, if the CAD file has four layers named A, B, C, and D, I want to import them into Grasshopper and extract the lines from each of these layers (A, B, C, and D) for further processing.

How can I do this? Thank you, everyone.

What file format?

Hello, Mr. Martin Siegrist,
The cad file is dwg format, thank you

In Rhino 8, you can feed the output of the Query Model Objects component into a Group Content component. You could then set the Key to be Layer Name and it will group the objects on each layer into different data tree branches in the output.

Dear Mr.Andy,
Thank for your reply! I will try it!