Created
January 12, 2023 15:01
-
-
Save johnpierson/3204a53b2f0a6011c89898b497dc74db to your computer and use it in GitHub Desktop.
The fixed graph for deleting all wall instances.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
clr.AddReference('RevitAPI') | |
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory | |
clr.AddReference('RevitServices') | |
from RevitServices.Persistence import DocumentManager | |
from RevitServices.Transactions import TransactionManager | |
doc = DocumentManager.Instance.CurrentDBDocument | |
walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements() | |
TransactionManager.Instance.EnsureInTransaction(doc) | |
for wall in walls: | |
doc.Delete(wall.Id) | |
TransactionManager.Instance.TransactionTaskDone() | |
OUT = "Success" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment