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.
I found a post about Reloading images but I can’t get it working.
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.
I managed to fix the code.
I am not good in using Python script but I thought this code would import all the images from a specific folder into my project.
is that correct?
Hi Robert,
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:
I am just starting to work through this (and I am no Dynamo expert at all) I also want to just reload all images in a project from the same directory that they are already in.
We use images for our design elements and the designers keep updating them (usually about 20). My hope is to just have a reload all images from same location
This would be no problem in revit if you could select multiple images in the image manager and click reload
I keep getting this error
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 33, in
IndexError: index out of range: 1
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.