Deleting elements using Python

Since you manually retyped it, we’d have to see what you typed. Otherwise we’re guessing at what you might have retyped wrong. Might be that you’re trying to pull an element ID from an element ID when you really want to convert the ID to an element.

You may also find it’s easier to use a node to do this instead of Python. There is one out of the box in Revit 2021 and on, and one in Archi-Lab, Springs, and others.