Python - Indentation or indentation

It's been a long time - as some of you may know, I've had an exciting new job since May and therefore haven't been blogging as much recently - but I've been blogging about Dynamo, Python & Co. all the more!

To warm you up, here's a little post for all those who are working with Python and, like me, are struggling with one or two error messages at the beginning:
Indentation plays an important role in Python and structures the script into function blocks. If the indentation is incorrect, you will receive the following error message in Dynamo:

08-07-2015 13-53-10

A correctly written Python script looks like this (note the red-framed blocks that structure the for query): 

03-07-2015 14-58-52

Without the indentation of the individual blocks, the above error message appears Syntax Errror: expected an indented block

->  More about blocks in Python (external link). 

In the future, there will be much more frequent smaller blog posts here, and I will also regularly publish articles on the official Autodesk BIM Blog publish.
Stay tuned! 😉

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Previous Article

Adaptive auxiliary objects in Revit, part 2

Next Article

Formulas in the Revit family editor