Speckle Scheduling App tutorial question

right so following from that tutorial, we should update it as it is subject to this:

The example fix code I shared in that post uses c#, but the python equivalent is trivial to use.

# This mimics the C# null-coalescing operator ?? and LINQ's FirstOrDefault
walls = my_commit.get("@walls") or next(
    (e['elements'] for e in my_commit['elements']
     if e['name'] == 'walls'), None)

print(walls)

If you have only recent commits from revit then you don’t need the conditional check.

walls = next(
    (e['elements'] for e in my_commit['elements']
     if e['name'] == 'walls'), None)
1 Like