Export Linked Images From Revit Model to Folder

I have not found any threads about exporting images from the manage links dialogue box. I want to repath 212 of them from one of my users local C drives to the server.

Are there any nodes that might help with this? Even if it just exports them and does not repath them would be super helpful.

hi,

an example with Python

import clr
import sys

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

def get_imgLocal_path(img_type):
    if img_type.RefersToExternalResourceReferences():
        for dict_externalRef in img_type.GetExternalResourceReferences():
            if dict_externalRef.Value.HasValidDisplayPath():
                for dict_info in dict_externalRef.Value.GetReferenceInformation():
                    if dict_info.Key == "Path":
                        return dict_info.Value

all_images = FilteredElementCollector(doc).OfClass(DB.ImageInstance).ToElements()
all_imagesType = [doc.GetElement(xId) for xId in set([e.GetTypeId() for e in all_images])]

OUT = all_imagesType, [get_imgLocal_path(img_type) for img_type in all_imagesType]
2 Likes