One-Click Surface solution

This sort of works. However only seem to match the layer to polyline/3D polylines that have the same elevation along its length - everything else is on layer 0 - frustrating!

Lines also seem to be proving a problem to create the CAD geometry with; it shows it in the Dynamo viewer but does not create the line when put back into CAD. Any help please?