Get current PrintDisplay state with rhinoscript


does anyone know how I cen get the current state of printdisplay state using rhinoscriptsyntax or rhinocommon?



Hi @timcastelijn, there is nothing in the SDK to query this, i’ve requested it 5 years ago:

@stevebaer will there be some improvements during the V7 lifecycle ? …also regarding other issues:



Hi Clement -

Just to manage expectations, this is what’s currently on the Rhino 7 list - i.e., at this point, 25 items.

Thanks @wim, no problem, i can wait :wink:


As a workaround you could read the command state from the command line after running and canceling the command. This is how I’d do it in RhinoScript, should be easy to translate to Python:

    Call Rhino.ClearCommandHistory()
	Call Rhino.Command("PrintDisplay EnterEnd")
	Dim h : h = Rhino.CommandHistory()
	h = Rhino.Strtok(h, "= ")
	Dim blnState
	If h(7) = "Off" Then blnState = False Else blnState = True
1 Like

Hi @Jarek,

thanks, your approach works for me. See my python version below


import rhinoscriptsyntax as rs
import Rhino
import re

def is_printdisplay_enabled():
    gets current state of PrintDisplay
        bool: True or False, or None when "State=(On|Off)" is not found
    rs.Command('-PrintDisplay EnterEnd', False)
    cli_text = Rhino.RhinoApp.CommandHistoryWindowText
    match ='State=(On|Off)', cli_text)
    if match:
        return == 'On' and True or False

# toggle Printdisplay
rs.Command('-PrintDisplay State Toggle EnterEnd', False)

# print current state
print is_printdisplay_enabled()
1 Like