Import Image to view

I am trying to work throught the example from @Konrad_K_Sobon and the post http://dynamobim.org/forums/topic/is-it-possible/. I would like to place an image (digital image of professional registration seal) on each sheet.

However I am a bit lost as to the error message as I am pretty sure I have copied it steps exactly (sure u did, i know…)
“Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 34, in
AttributeError: ‘ImageType’ object has no attribute 'ToDSType”

Can u spot where I jacked this up?

<a class=“attachment”

href="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/dynamobim/original/2X/0/04ca7a9295965f31aae815201c538df1878efa33.dyn">ss.dyn (12.4 KB)

can you post the actual code? this forum is much better than old one and supports code so let’s not ask anyone willing to help you to retype that code.

1 Like

Sorry Konrad,
Thank you so much for taking the time to post at all. Below is everything

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#Import documentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

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

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

filePath = IN[0]
runIt = IN[1]

if runIt:
	tempName = filePath.split("\\")
	elementName = tempName[len(tempName)-1]
	
	imgs = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RasterImages).WhereElementIsElementType().ToElements()
	
	for i in imgs:
		if i.ToDSType(True).Name == elementName:
			imageOut = i
			break
		else:
			continue
	
	TransactionManager.Instance.EnsureInTransaction(doc)
	imageOut.Reload()
	TransactionManager.Instance.TransactionTaskdone()
	message = "Success Bitches!"
else:
	message = "Set RunIt to True."
#Assign your output to the OUT variable.
OUT = message

See https://github.com/DynamoDS/Dynamo/issues/2460

Is your matter fixed now?