Rhino Script Scheduled Run

Hi All,

I’m working on a program that will take a user supplied text file template or (eventually) via a SQL query, then convert it to a drawing.

The idea is that the text files will be created periodically throughout the day, the script should detect new files via one of two ways - either polling a network folder looking for new files (short term), or by polling a SQL query (end goal).

In both cases, I understand that Python isn’t great for polling in code. The advice I’ve found so far suggest that you create a script, then use Windows task scheduler (or equivalent) to run the script periodically.

My program initially started as an external python program that used RhinoCommon to create the 3dm file, but it also needs to export PDF and DXF files. As I understand it, RhinoCommon can’t do this (LINK), so I’ve moved my code to work within Rhino via the script editor.

With all that in mind, what options do I have for polling a folder or SQL Query?
One option that comes to mind is to set my python script as a start up script, then periodically run rhino and close when complete, but the hope is that this script will run on a users machine, so running in the background is fairly important.

Thanks in advance.

For small projects watchdog is a good library - it runs as system background process. You can use it to trigger scripts at certain events i.e file aded / updated that then run / process on your users’ Rhino files. We’ve done it on network before, it works great.

Thanks for that. I should have added, that the end goal is SQL, but monitoring a folder is an interim solution.

I’ll check out watchdog for now though.

1 Like

Edit

did you check