I am trying to get a modified script from @Konrad_K_Sobon working in my project so I can help someone on the Autodesk Community Forum with his case.
What I want to do is loading and reloading all the images in a specific folder to my Revit project.
That error message is typically caused by spaces rather than tabs being used to indent your code. Python uses indents instead of curly brackets to define blocks of code.
If you’ve copied all that code from an online source etc, then you might find every indent are spaces. In that case, the easiest thing to do is highlight the existing indent space for each line, backspace (delete), then tab the line back to the same position. As a fail safe, you should backspace until your line starts on the previous line, hit carriage return (i.e. enter key) then tab, otherwise you’ll risk recurring syntax errors.
As far I can tell from reading the code it will look at the names of every image in your Revit file and if it finds matching file names in the supplied directory it will reload those images in your project.
If you want to check the filenames that the code is reading from the directory you could try adding this to your OUT node:
Not pretty but it works just fine. The only thing is to make sure the file is saved before you run the script. This atleast reloads all the jpegs in the saved directory without manual pathing. If anyone has a cleaner way of doing it let me know. or away to autosave the file before
well I thought I had it but then I did it on a live project and enabled worksets. this makes you file local. so I used the node Document.CentralPath. and it looked correct, but once I run it it only reloaded 1 jpeg ugh.