Command to repeat print a layout with different layers showing?

I have many sequentially named layers, and I want to make pdf pages with the same layout showing one by one the different layers in sequence. I use predominantly Rhino Script. What is the command to print a layer in pdf in RhinoScript, and what other suggestions are there to complete this task?

by rhinoscript you mean vbscript based rvb ?
or python rhinoscriptsyntax.

this is the official sample from the documentation on LayerVisible:

import rhinoscriptsyntax as rs
layers = rs.LayerNames()
if layers:
    for layer in layers:
        if rs.LayerVisible(layer)==False:
            rs.LayerVisible(layer,True)

post your script - and tell us what is not working - this is easier then helping from scratch.
pdf - check other topics - maybe a good starting point:

best - tom

Thank you very much Tom!

Yes, I suppose I mean VBScript, this is how I have written my other (short and simple) macros.

My main issue was that I could not understand how to create commands to print the layout. Essentially I want to automate the right click-Print Layout command. So the loop would look like:

Start loop, i=0

  • Turn all layers off
  • Turn layer i+1 on
  • Print layout
  • i = i+1

Exit loop.

I will try your suggestions, thank you.