How to Change Multiple Grid from 3D to 2D

Can you change multiple grid lines from 3D to 2D by Dynamo Code or do you have to do them one by one if all axis located inside the crop region

Can you share your dynamo graph?