Hello,
I can`t find stacked walls as category! How can I get them. How should the script look like?
KR
Andreas
I can`t find stacked walls as category! How can I get them. How should the script look like?
KR
Andreas
There is a property in the RevitApi: Wall.IsStackedWall
You can use this Python to see which walls are stacked walls:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
clr.AddReference('System')
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
if isinstance(IN[0],list):
walls = UnwrapElement(IN[0])
else:
walls = [UnwrapElement(IN[0])]
out = [w.IsStackedWall for w in walls]
OUT = out
StackedWallFilter.dyn (6.6 KB)
Can I do it allso with all elements of category? or have I to select all walls in a 3D-View?
When you use AllElementsOfCategory you get the sub-walls instead of the stacked walls.
In this example I have only one Stacked Wall:
You can use this script to collect all StackedWalls in your project:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
clr.AddReference('System')
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
collector = FilteredElementCollector(doc, doc.ActiveView.Id)
filter = ElementCategoryFilter(BuiltInCategory.OST_StackedWalls)
stackedWalls = collector.WherePasses(filter).ToElements()
OUT = stackedWalls
Can i get the wall line location for the different layers of the stacked wall?
This is what I do to get my Stacked Walls in the project (there is only one) :
Hi @vncd,
I will do this to find the wall line locations for the different layers of the stacked wall.
Please note that this may require more filtering to select only the correct wall instances in a real project.