2026, Jan 08 07:00
Get Real-Time Progress in Revit Python Shell: Stop Buffered Prints, Flush ACC Output, Use TaskDialog or a Modeless Log Window
Learn how to get real-time output in Revit Python Shell: fix buffered stdout, show progress with Alert/TaskDialog, stream ACC logs with unbuffered I/O, flush
Real-time feedback matters when you automate in Revit. If you rely on Revit Python Shell (RPS) and notice that print output appears only after a long-running loop completes, you are likely running into output buffering. For progress reporting, status updates, or streaming results from an external tool like AcCoreConsole (ACC), that default behavior gets in the way.
Minimal reproduction of the buffered output
The following loop prints once per second, but RPS shows all lines only after the loop ends, not as they are produced.
import time
for step_idx in range(1, 100):
print step_idx
time.sleep(1)
What’s happening
RPS buffers the standard output stream. That means your print calls accumulate in memory and are flushed to the console in a batch, typically after the script finishes. This is common for embedded consoles and explains why sleep calls do not force the updates to appear incrementally. If your workflow depends on progressive updates, you need a different output channel or explicit flushing behavior.
Looks like you are using python2 which is prehistoric and no longer supported, start by switching to python3...
The snippet above uses Python 2 print syntax, which fits the observation.
Practical ways to show progress immediately
One route is to bypass stdout entirely and surface progress through UI prompts. RPS ships with helpers that make this straightforward. This approach replaces the buffered console with visible popups on each iteration.
from rpw.ui.forms import Alert
import time
for seq_no in range(1, 100):
Alert('Processing: {}'.format(seq_no))
time.sleep(1)
You can also use Revit’s native dialog API to surface the same information. This achieves the same effect: interactive, immediate feedback on progress.
from Autodesk.Revit import UI
import time
active_ui_doc = __revit__.ActiveUIDocument
for seq_no in range(1, 100):
UI.TaskDialog.Show("Status", "Processing: {}".format(seq_no))
time.sleep(1)
When your workflow involves ACC (AcCoreConsole), streaming output as it is produced is crucial. You can start the process in unbuffered mode and manually flush both the process pipes and your own stdout to avoid delays.
import sys
import subprocess
import time
acc_handle = subprocess.Popen(['AcCoreConsole.exe'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=0,
universal_newlines=True)
for src_path in file_queue:
acc_handle.stdin.write(src_path + '\n')
acc_handle.stdin.flush()
while True:
line = acc_handle.stdout.readline()
if line == '':
break
print(line.strip())
sys.stdout.flush()
time.sleep(0.1)
acc_handle.stdin.close()
acc_handle.terminate()
Another effective pattern is to render logs in your own modeless window. This avoids stdout buffering entirely and keeps the UI responsive during long operations.
from rpw.ui.forms import FlexForm, Label, Button
import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import Form, TextBox, DockStyle, FormBorderStyle
import time
log_win = Form()
log_win.Text = "Processing Output"
log_win.Width = 600
log_win.Height = 400
log_area = TextBox()
log_area.Multiline = True
log_area.Dock = DockStyle.Fill
log_area.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
log_win.Controls.Add(log_area)
log_win.Show()
for item_idx in range(1, 100):
log_area.AppendText("Processing item {}\n".format(item_idx))
System.Windows.Forms.Application.DoEvents()
time.sleep(1)
Why this matters
Buffered output hides the state of your automation. When you orchestrate external tools, parse their responses, and stream updates to users, silent periods erode trust and make troubleshooting harder. Immediate progress reporting shortens feedback loops, makes long tasks feel responsive, and lets you react instantly to failures or malformed output.
Takeaways
If print in Revit Python Shell is buffered, treat stdout as last resort for real-time feedback. For quick visibility, surface progress with Alert or TaskDialog. For streaming data from ACC, open the process with unbuffered pipes and flush aggressively while reading line by line. For a richer experience, attach a modeless log window and append as you go. And if your scripts still rely on Python 2 semantics, consider the implications for maintenance and tooling going forward.