How to Set Image Parameter to None or Empty?

I am using an image parameter for QR codes. When elements are copied, the existing image parameter comes with it. If the copied element gets a new QR code image, no problem, it writes over the old one. If the copied element does not get a QR code, the old one stays with it.

How can I clear the image parameter, or set it to “None” ?

image

image
Element.SetParameterByName

Try null, or an empty string.

Nice idea, but it didn’t like Null or empty string, or even empty list.
In the element properties for the image I am able to enter there to clear it, but the node does not want to pass that, because it is text.

I think you need to feed it an ElementId.InvalidElementId to make it work.

image

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

OUT = ElementId.InvalidElementId
1 Like

Thanks for the response Sean…it’s still not happy.

So the error message says that it’s looking for a “Double” which just like in Revit that once you change a number parameter you can’t make it (none) again… I don’t think

1 Like