How to automate sending of .stl file from cad software to 3D Slicer by scripting

How can I make a script in windows for transferring of .stl file from any folder or from CAD software to slicer automatically.

To send from a script or application outside of Slicer, something like this would work:

Slicer.exe --python-code "slicer.util.loadModel( 'f/pth/to/model.stl' )" 

This will launch Slicer and load the requested stl model. To load models into an already launched Slicer, something like this python snippet would work within Slicer to have it monitor a folder to automatically load items saved there.

1 Like