# Expose file location for raster images

**URL:** <https://forum.dynamobim.com/t/expose-file-location-for-raster-images/38124>\
**Category:** Revit\
**Created:** [July 10, 2019, 1:08am UTC](https://forum.dynamobim.com/t/expose-file-location-for-raster-images/38124 "2019-07-10T01:08:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david-f](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@david-f](https://forum.dynamobim.com/u/david-f)\
**Post date:** [July 10, 2019, 1:08am UTC](https://forum.dynamobim.com/t/expose-file-location-for-raster-images/38124/1 "2019-07-10T01:08:18Z")

</div>

Hi All,

I’ve been looking into reloading raster images during a server migration. I’ve found some info to reload raster images based on a link, however what I would like to do is expose the existing path, then run a modifier (lets say change drives from X: to Y: ) then re-link them.

The link location is not a parameter that’s exposed in the element parameters and raster images are not exposed in any node I’ve been able to find (these nodes expose CAD, RVT, IFC etc).

I think there will be a python way of doing this, however I have no experience in python.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [July 10, 2019, 4:21pm UTC](https://forum.dynamobim.com/t/expose-file-location-for-raster-images/38124/2 "2019-07-10T16:21:40Z")

</div>

Hey,

I think something like this should work…

```
#thanks to Nicklas Østertgaard nvo@bimshark.com / nvo@shl.fk
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
collector = Autodesk.Revit.DB.FilteredElementCollector(doc)

imageTypes = collector.OfClass(Autodesk.Revit.DB.ImageType)

newDriveLetter = IN[0]
relinkedImages = []

for i in imageTypes:
	path = i.Path
	newPath = ("".join((path[:0],newDriveLetter,path[1:])))
	
	TransactionManager.Instance.EnsureInTransaction(doc)
	i.ReloadFrom(newPath)
	TransactionManager.Instance.TransactionTaskDone()
	
	relinkedImages.append(i)

OUT = relinkedImages

```

I can’t do the final bit without remaking the server path… But if I comment it out, the rest seems to work…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/3/a38fbfb4e946cf87c984a37a67919af2ac793b36.png)

If you have a list of newDriveLetters we’d need to modify the code a bit.

Hope that’s useful,

Mark
