Deleting elements using Python

Hello guys, i’m a very beginner at python programing, i’m trying to get some walls deleted with revit API in python but got an issue !
the Python shell tells me “expected element got wall” but i’m using all ELEMENTS of category !! Please some help

The delete method expects element ids, not the actual element :slight_smile:


@Martin_Spence1 thank you !! it worked fine :slight_smile:

Sweet :+1::slight_smile:

Hi, so the Element.ID node gives the Revit element ID as a string, how can that be fed into the Python script? Thanks

worked it out, just need to add:

ID = Autodesk.Revit.DB.ElementId(walls)