How to get stacked wall?

2019-03-20_09h05_01
Hello,

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)

1 Like

Can I do it allso with all elements of category? or have I to select all walls in a 3D-View?2019-03-20_09h31_30

When you use AllElementsOfCategory you get the sub-walls instead of the stacked walls.

In this example I have only one Stacked Wall:

  • when I select it, I get the stacked wall: Brick Over Block
  • when I use AllElementsOfCategory I get the basic walls: 1 = Brick, 2 = Block

StackedWall2

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

StackedWall3

2 Likes

Looks strange:

1 Like

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) :

stackwalls

1 Like

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.

1 Like