Render command

Here is a little script that I made to avoid rendering the wrong viewport.
Specially in big scenes, it’s frustrating to click render only to realize that you had the wrong viewport active and specially with vray where the whole scene is loaded in memory first, it can take a long time before you are able to cancel the command. Most times I only mean to render the perspective or non-orthogonal viewport and that gives me at least heads up if I’m in the wrong one.
It wont cover all the options but it helps me most times.

Replace the render button with this:

import rhinoscriptsyntax as rs

      
def Render_iso():
    vports = rs.ViewNames(True, 0)
    cv = rs.CurrentView()
    ortho = ["Top","Bottom","Front","Back","Right","Left",]
    if cv not in ortho: rs.Command("!_Render", echo=True)
    else:
        rend = rs.GetString (message="View is orthogonal, render? Y/N", defaultString="N", strings=["Y", "N"])
        if (rend == "Y"): rs.Command("!_Render", echo=True)
   
Render_iso()