# Question re: sequential baking

**URL:** <https://discourse.mcneel.com/t/question-re-sequential-baking/127989>\
**Category:** Grasshopper Developer\
**Created:** [July 26, 2021, 8:11pm UTC](https://discourse.mcneel.com/t/question-re-sequential-baking/127989 "2021-07-26T20:11:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![declan](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/declan/32/481847_2.png) [@declan](https://discourse.mcneel.com/u/declan)\
**Post date:** [July 26, 2021, 8:11pm UTC](https://discourse.mcneel.com/t/question-re-sequential-baking/127989/1 "2021-07-26T20:11:21Z")

</div>

Hi all,

I’m trying to create a python script to retrieve all STL names in a folder, and then for each STL, import the filename and bake out geometry.

Most of the heavy lifting is already setup, thanks to Human. I am now just trying to figure out how to run the .gh definition once for each STL and wait for it to computer before baking & exporting. Then continue on to the next file.

Here is how I have started.

“”"  
RunBatch = bool toggle  
STLs = input string of filenames  
C = int (length of STLs list)  
AllSTLs = output string just for panel display/debug  
ThisSTL = output string for us within the .gh definition  
Bake = output bool for Human Bake component  
“”"

import rhinoscriptsyntax as rs  
import Rhino

STLList =   
i = 0

if RunBatch:

```
STLList.append(STLs)
AllSTLs = STLList
for i in range(C): 
    ThisSTL = STLList[i]
    Bake = True
    Bake = False
    i += 1

```

I’m sure this is pretty far from functional regarding the Bake stuff, but the STL name import does work, and AllSTLs does display the full list as expected.

Can anyone point me in the right direction? I’m sure this has been discussed ad nauseum…

tx!

---

<div class="post-metadata">

**Author:** ![declan](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/declan/32/481847_2.png) [@declan](https://discourse.mcneel.com/u/declan)\
**Post date:** [August 2, 2021, 11:21pm UTC](https://discourse.mcneel.com/t/question-re-sequential-baking/127989/2 "2021-08-02T23:21:08Z")

</div>

Bump! Hoping for a kind soul to guide me.
