Load images to project?

Hi All,

Is there any node/package that loads i8mages from a folder? i cant find anything. Thanks.

I am not awara of any package or node. Still the method is exposed in the Revit API -
http://www.revitapidocs.com/2015/493d203e-ef4c-b447-f979-52b22725b2ad.htm
You could write a python script.
Hope this gives you a starting point.

Something like this should work to import all pictures from a folder:

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

path = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])

TransactionManager.Instance.EnsureInTransaction(doc)

opt = ImageImportOptions()

for x in path:
    try:
        doc.Import(x,opt,view)
        out = "success"
    except:
        out = "fail"

TransactionManager.Instance.TransactionTaskDone()

OUT = out
1 Like

Thank you. I’ve got similar approach, but im not well on python. I’d like also to check if the image already exist in the project then dont import and continue if it’s not on the project? How do i do that? inside python?

There was an answer to the same question here: Is it possible?

2 Likes

thanks Konrad, Is there a way to see it in higher resolution?

I have had a node for this some time…

I can see that i have been writing about it before…

3 Likes

Solved! Thanks guys! Found 2 solutions, 1 from PeterPpenchev1 , lucamanzoni & Konrad, (with view options) and one method from @erfajo (document importImage)

1 Like