Is there a way to tell if F5 or F6 is used

2 views
Skip to first unread message

Matthieu Hendriks

unread,
Feb 28, 2026, 5:38:44 AMFeb 28
to PythonSCAD
When I'm running a pythonscad (python) programm and press F5 the compleet script is run, If I press F6 also the complete script is run.
Is there a way of determining if the script is started with F5 or F6?

Why this question: I export my design from within the script to 3mf, would be nice to do this only with F6

Guenther Sohler

unread,
Feb 28, 2026, 5:54:45 AMFeb 28
to Matthieu Hendriks, PythonSCAD
In OpenSCAD there is variable $preview, which holds this information. 
In PythonSCAD this is missing. Should go to TODO list

--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/e10c30e0-bd5e-48f9-8d54-025c7491f69an%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthieu Hendriks

unread,
Feb 28, 2026, 6:13:21 AMFeb 28
to PythonSCAD
I tried the change in MainWindow.cc

added after line 2029:     initPython(venv, fnameba.constData(), this->animateWidget->getAnimTval());
    evaluatePython(this->isPreview ? "preview = True" : "preview = False", true);


sames to work :)


Op zaterdag 28 februari 2026 om 11:54:45 UTC+1 schreef guenthe...@gmail.com:
Reply all
Reply to author
Forward
0 new messages