Cleaning Rhino Terminal from Python?

How can I do this with Python?

Like this:

import Rhino

for i in range(1000):
    Rhino.RhinoApp.WriteLine("")

On a more serious note, the correct method to use is this: :wink:

import Rhino
Rhino.RhinoApp.ClearCommandHistoryWindow()

:rofl: :+1:

But I don’t want to clean the command history just this list there. You know in cmd if you enter cls you can still get your previous commands using the [kbd]UpArrow[/kbd]

sidenote: what’s with the kbd tag :frowning: ? @dan ?

I’m not sure, is there even a type of up and down arrow function in rhino for the commandline?

It was just an example that cls does not clean the history just the screen/terminal in CMD

Well going solely by the name of that function i would assume it behaves exactly like cls

It doesn’t, it also cleans up the history of the commands.

try this:

  1. start several commands. Place some points in 3d.
  2. launch this from python:
import Rhino
#Rhino.RhinoApp.ClearCommandHistoryWindow()
print Rhino.RhinoApp.CommandHistoryWindowText

3 . then try your command
4 . and again launch step 2.

Result:
The commands that you used to create the objects are not displayed, they are removed from the history. I want to simply clean this window without deleting the history.

I run some commands…

I call the function:

Rhino still knows the history of commands, just the Text has been cleared, exactly like cls

Try this out:

import Rhino
print Rhino.RhinoApp.CommandHistoryWindowText
Rhino.RhinoApp.ClearCommandHistoryWindow()
print Rhino.RhinoApp.CommandHistoryWindowText
for command in Rhino.Commands.Command.GetMostRecentCommands():
    print command.DisplayString
1 Like

Thanks @lando.schumpich

UpArrow

<kbd> UpArrow </kbd>

1 Like

something
<kbd>something</kbd>

:man_facepalming:

2 Likes